Skip to content

Amplifiers ​

Amplifiers are given by their Table VI field letter and placed where the standard's figure for the symbol's frame puts them: land units by Figure E-3, equipment E-4, installations E-5, air and space D-3 and C-2, sea surface G-2, subsurface H-3, dismounted individuals F-2, activities I-2, cyberspace K-2.

ts
renderSymbol('130310000012110000000000000000', {
    amplifiers: {T: '1-66', M: '2BCT', H: 'REINF', W: '141200ZNOV26', Q: 45},
});

Which fields a symbol takes ​

Not every symbol has a place for every field: a land unit has no T1 or W1, and a point control measure takes only what its Appendix L template shows. amplifierFields says what a symbol takes, so an editor offers those and nothing else:

ts
import {amplifierFields, validateAmplifier} from '@zaes/military-symbols';

for (const f of amplifierFields('130310000012110000000000000000')) {
    // f.field 'F', f.kind 'text', f.title 'Reinforced or reduced', f.maxLength 1,
    // f.values [{value: '+', label: '+ reinforced'}, ...], f.format for patterned fields
}
validateAmplifier('F', '34'); // 'F (Reinforced or reduced) is one of +, -, ±'
validateAmplifier('W', '141200ZNOV2026'); // undefined: a valid date-time group

kind is text (written beside the symbol), graphic (Q, AJ) or map (AH, AI, AK, below). values is Table VI's list where it gives one (F, J, K, L, AD, AQ, AR) and the GENC countries for AS; format describes a patterned field (date-time groups, altitude, speed, IFF mode, the engagement bar). AMPLIFIER_SPECS holds the same for every field.

renderSymbol reports in problems a field the symbol has no place for (it is not drawn) and a value Table VI does not allow (it is drawn as given). RenderedSymbol.fields lists the fields the drawing placed.

Text fields ​

Text fields are written in columns either side of the frame, five rows to the octagon's height; fields that share a row are joined. A value longer than Table VI allows is cut, with a problem saying so (AMPLIFIER_MAX_LENGTH holds the limits).

  • AS, the country, defaults to the GENC trigraph of positions 28–30 of the code. Pass countryFromCode: false to leave it off.
  • C sits over air and space frames, AA inside the frame.
  • AO, the engagement bar, draws on top of everything in the symbol's own fill (5.3.7.15).
  • textColor, textHalo, textHaloColor and font style them.

Graphic fields ​

Field
Qdirection of movement (5.3.7.9), degreesan angled arrow from a land frame's base (a headquarters staff's foot), from the center otherwise
AJspeed leader (5.3.7.13.3){direction, length}, its length in pixels, which the host keeps current

Fields measured on the ground ​

Three fields are distances on the ground, so renderSymbol does not draw them; the map entries draw them in map units, under the symbol, however it is drawn:

FieldShapes
AHarea of uncertainty (5.3.7.13.1)ellipse, box, or a line of bearing with its error lines
AIdead reckoning trailer (5.3.7.13.2)a dotted line from the last reported position, or the farthest-on circle
AKpairing line (5.3.7.13.4)a line to another symbol (target, kept current for you) or to a fixed position (to)
ts
const track = {
    name: '130301000011010000000000000000',
    amplifiers: {
        AH: {shape: 'ellipse', semiMajor: 900, semiMinor: 400, orientation: 30},   // meters
        AI: {shape: 'line', from: [-116.70, 35.20]},
        AK: {to: [-116.55, 35.31], dotted: true},
    },
};

Lines are 2 px and dotted lines 2 px dots with 4 px gaps, black unless color is given.

Pairing with another symbol ​

Give the pairing line a target, the id of another symbol in the same MilitaryCollection, and the collection keeps the line on that symbol:

ts
collection.add({type: 'Feature', id: 'bomber', geometry: {type: 'Point', coordinates: [-116.52, 35.22]},
    properties: {military: {name: bomber}}});
collection.add({type: 'Feature', geometry: {type: 'Point', coordinates: [-116.42, 35.18]},
    properties: {military: {name: fighter, amplifiers: {AK: {target: 'bomber', to: [-116.52, 35.22], color: '#0072CE'}}}}});
  • When either symbol moves, to is rewritten to where the target stands, in the same undo step as the move. Undo and redo bring the line back with the symbols.
  • On the OpenLayers and MapLibre maps the line ends on the target's frame center: right of and above the location for a headquarters, whose staff hangs from the frame's left edge.
  • to stays the target's last known position. Leaflet, ArcGIS and a saved file draw from it without the collection.
  • If the target is removed, the line keeps its last position and loses the link; undo restores both. A symbol replaced in place (removed and added again with the same id) keeps its links.
  • Loading a file whose ids are already taken renames them, and the links follow the new ids.
  • A symbol can't be paired with itself.

Without target, to is a fixed position, and keeping it current is the host's job.

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