@orbat-mapper/point-symbols
v0.1.0-alpha.1
Published
Milsymbol-backed MIL-STD-2525 and APP-6 point symbols for tactical-draw.
Readme
@orbat-mapper/point-symbols
Optional milsymbol-backed point-symbol rendering for
@orbat-mapper/tactical-draw. Installing this package is opt-in; applications
that only use control measures do not install or bundle milsymbol.
Installation
pnpm add @orbat-mapper/point-symbols milsymbolmilsymbol is a peer dependency so the host and this capability share one
instance and its global registries.
Usage
import { TacticalDraw } from "@orbat-mapper/tactical-draw";
import { milsymbolPointSymbols } from "@orbat-mapper/point-symbols";
const pointSymbols = milsymbolPointSymbols();
const tacticalDraw = new TacticalDraw(adapter, { pointSymbols });
tacticalDraw.render([
{
id: "unit-1",
kind: "point-symbol",
sidc: "130315003611010300000000000000",
position: [10.75, 59.91],
rotation: 0,
size: { value: 32, unit: "pixels" },
},
]);Use renderPointSymbol(symbol) for standalone synchronous SVG rendering.
Capability instances may be shared by several TacticalDraw facades and retain
an LRU render cache. Call capability.invalidate() after changing milsymbol's
global configuration.
The bundled capability emits SVG produced by milsymbol. A custom
PointSymbolCapability must return trusted or sanitized SVG: the Leaflet
adapter inserts that SVG into the live DOM when it constructs a divIcon.
License
MIT
