Skip to content

Introduction ​

@zaes/military-symbols draws the single-point symbols of MIL-STD-2525 and APP-6: a unit, a piece of equipment, an installation, an activity, a point control measure. Give it a code and it returns the symbol, drawn as the standard draws it.

ts
import {renderSymbol} from '@zaes/military-symbols';

renderSymbol('130310000012110000000000000000').svg;   // a friendly infantry unit

What it draws ​

Every single-point symbol, in five standards:

StandardCodesDrawings
MIL-STD-2525E Change 130-digit numeric, version 13 and 15built in
MIL-STD-2525D Change 120 or 30-digit numeric, version 10 and 11/2525d
MIL-STD-2525C15-character letter codes/2525c
MIL-STD-2525B Change 215-character letter codes/2525b
APP-6(B)15-character letter codes/app6b

For each: the frame of every symbol set and standard identity, the icons, the sector modifiers, the headquarters, task force, feint and dummy marks, echelon and mobility, operational condition, and every amplifier the standard places, by its field letter. The point control measures of symbol set 25 are drawn where their draw rule takes one anchor point at a fixed screen size.

What it does not draw: control measures drawn from several points or sized in map units (lines, areas, range fans), and the weather and ocean sets 45 and 46. Those are separate libraries.

Two packages ​

  • @zaes/military-symbols draws. Its root has no map library and reads no DOM when it loads, so it runs in a page, a worker or Node. Map entries add OpenLayers, MapLibre, Leaflet and ArcGIS.
  • @zaes/sidc reads, validates and writes the codes, and carries the 2525E catalog: every entity's name, hierarchy and kind. It has no dependencies. See Codes.

Reports, never refuses ​

A code the standard does not define, a value out of range, an amplifier too long: the symbol is drawn as far as it can be and every such thing is listed in problems. Only a code that cannot be read at all returns nothing.

ts
const {svg, problems} = renderSymbol('130310000012110000990000000000');
problems;   // ['no drawing for sector 2 modifier 99 of symbol set 10']: the infantry is drawn, the modifier is not

Released under the MIT License; the drawings derive from Apache-2.0 work.