Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/spatialillusions/milsymbol/llms.txt

Use this file to discover all available pages before exploring further.

Every milsymbol Symbol object is configured through an options object that can be passed at construction time or applied later via setOptions(). Options fall into three categories: a general option (sidc) that identifies the symbol, modifier options that map to standard-defined text and graphical fields, and style options that control visual appearance. Because the symbol re-renders automatically whenever options change, it is more performant to supply all known options up front rather than calling setOptions() repeatedly.

Passing Options

Options can be supplied at construction time as a second argument (or as the first argument when using an object-only signature), or updated at any time on an existing symbol instance.
// At construction time
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  uniqueDesignation: "1-68 AR",
  higherFormation: "3ID",
  colorMode: "Light"
});

// After construction
symbol.setOptions({ size: 80, direction: 45 });

// Chaining — create a symbol and immediately get its SVG
var svg = new ms.Symbol("SFG-UCI----D", { size: 30 }).asSVG();
The constructor accepts multiple option objects as additional arguments, and they are merged left-to-right:
var sym = new ms.Symbol("SFG-UCI----D", { size: 30 }, { colorMode: "Dark" });
You can retrieve the current options at any time using getOptions():
var opts = symbol.getOptions();          // includes style options
var opts = symbol.getOptions(false);     // modifier/text options only

General Options

OptionTypeDefaultDescription
sidcString''The SIDC for the symbol. Can be a letter-based SIDC (e.g. "SFG-UCI----D") or a 30-digit number-based SIDC.

Modifier Options

Modifier options correspond to standard-defined fields from MIL-STD-2525 and APP-6. They are rendered as text or graphical elements around the symbol when infoFields is true (the default).
OptionTypeDefaultDescription
additionalInformationString''A text modifier for units, equipment, and installations; content is implementation specific. Field H20 characters
altitudeDepthString''Displays altitude flight level, depth for submerged objects, or height of equipment/structures on the ground. Field X14 characters
auxiliaryEquipmentIndicatorString''Auxiliary equipment indicator modifier.
installationCompositionString''Installation composition modifier. Field AI
combatEffectivenessString''Indicates unit effectiveness or installation capability. Field K5 characters
commonIdentifierString''Common name identifier, e.g. "Hawk" for the Hawk SAM system. Field AF
countryString''Three-letter country code. Field AC
directionNumberundefinedDirection of movement in degrees (0–360). Set to undefined to remove the direction arrow. Field Q
dtgString''Date-time group in format DDHHMMSSZMONYYYY or "O/O" for on order. Field W16 characters
engagementBarString''Engagement bar text, arranged as A:BBB-CC. Field AO
engagementTypeString''Engagement bar type — one of "TARGET", "NON-TARGET", or "EXPIRED". Controls the bar fill color.
equipmentTeardownTimeString''Equipment teardown time in minutes. Field AE
evaluationRatingString''One-letter reliability rating and one-number credibility rating. Field J2 characters
guardedUnitString''Unit designated as guarded during ballistic missile defence. Field AQ2 characters
headquartersElementString''Headquarters element indicator, e.g. "TOC" for Tactical Operations Centre. Field AH
higherFormationString''Number or title of higher echelon command (corps designated by Roman numerals). Field M21 characters
hostileString''Letters "ENY" denoting hostile equipment symbols. Field N3 characters
iffSifString''IFF/SIF identification modes and codes. Field P5 characters
locationString''Symbol location in degrees/minutes/seconds, UTM, or other applicable format. Field Y19 characters
platformTypeString''"ELNOT" or "CENOT". Field AD
quantityString''Number of items present in an equipment symbol. Field C or Field R9 characters
reinforcedReducedString''(+) for reinforced, (-) for reduced, (±) for both. Field F3 characters
sigintString''"M" = Mobile, "S" = Static, "U" = Uncertain. Field R2
signatureEquipmentString''"!" indicates detectable electronic signatures for hostile equipment. Field L1 character
specialDesignatorString''Special track designators such as Non-Real Time (NRT) or Tactically Significant (SIG). Field AR3 characters
specialHeadquartersString''Name of special C2 Headquarters — rendered inside the frame. Field AA9 characters
speedString''Velocity as set forth in MIL-STD-6040. Field Z8 characters
speedLeaderNumber0Length of the speed leader line in pixels, independent of symbol size.
staffCommentsString''Staff comments; content is implementation specific. Field G20 characters
typeString''Indicates type of equipment. Field V24 characters
uniqueDesignationString''Uniquely identifies a particular symbol, track number, or SIGINT acquisition number. Field T21 characters

Example: Rich modifier set

var symbol = new ms.Symbol("130315003611010300000000000000", {
  size: 35,
  quantity: "200",
  staffComments: "FOR REINFORCEMENTS",
  additionalInformation: "ADDED SUPPORT FOR JJ",
  direction: (750 * 360) / 6400,
  type: "MACHINE GUN",
  dtg: "30140000ZSEP97",
  location: "0900000.0E570306.0N"
});

document.body.appendChild(symbol.asCanvas());

Style Options

Style options control visual appearance — colors, fills, sizes, outlines, and rendering behavior.
OptionTypeDefaultDescription
alternateMedalBooleanfalseUse alternate MEDAL icons for mine warfare symbols instead of the default MEDAL icons (MIL-STD-2525D).
civilianColorBooleantrueUse purple as the optional color for civilian symbols as specified in 2525C.
colorModeColorMode or String'Light'Fill color mode for the symbol. Pass a registered color mode name ("Light", "Medium", "Dark") or a ColorMode object created with ms.ColorMode(...).
fillBooleantrueWhether the symbol is filled with color.
fillColorString''Directly override the fill color of the symbol with any CSS color string.
fillOpacityNumber1Opacity of the symbol fill color (0–1).
fontfamilyString'Arial'Font family for all text fields surrounding the symbol.
frameBooleantrueWhether the symbol has a frame. All symbols support unframed rendering.
frameColorColorModefalseOverride the color of the symbol frame.
hqStaffLengthNumberundefinedOverride the global headquarters staff line length for this symbol.
iconBooleantrueWhether the symbol has an icon drawn inside the frame.
iconColorColorModefalseOverride the color of the symbol icon.
infoBackgroundColorMode or String''Background color drawn behind text modifier fields.
infoBackgroundFrameColorMode or String''Stroke color for the border of the text modifier background area.
infoColorColorMode or StringSame as frame outlineColor used for text in the modifier fields surrounding the symbol. Accepts a ColorMode object or a CSS color string.
infoFieldsBooleantrueIf false, text fields and direction are not rendered even if set, allowing you to store modifier data without displaying it.
infoOutlineColorString or falsergb(239, 239, 239)Color of the outline drawn around text fields, or false to fall back to outlineColor.
infoOutlineWidthNumber or falsefalseWidth of the outline drawn around text fields, or false to fall back to outlineWidth.
infoSizeNumber40Size of the text fields relative to symbol size. 40 means 40% of the default size of 100.
monoColorString''CSS color string. When set, the symbol renders as monochrome and unfilled using this color.
outlineColorColorMode or Stringrgb(239, 239, 239)Color of the outline drawn around all symbol parts. Defaults to off-white.
outlineWidthNumber0Width of the outline drawn around all symbol parts. 0 means no outline.
paddingNumber0Extra whitespace added around the symbol bounding box in pixels.
sizeNumber100The L value — the width of the icon octagon in pixels.
simpleStatusModifierBooleanfalseUse simplified dashed-line status modifiers. This is the default for unfilled symbols and can be forced on filled symbols.
squareBooleanfalseOutput the symbol as a square with the insertion point at the center.
stackNumber0Number of additional unit copies to stack behind the main symbol. 0 = one unit, 3 = four units total.
standardString''Override the global standard for this symbol: "2525" or "APP6".
strokeWidthNumber3Stroke width of the symbol paths.

Example: Style options

// Dark color mode, with outline and custom font
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  colorMode: "Dark",
  outlineWidth: 4,
  outlineColor: "black",
  fontfamily: "Roboto, sans-serif",
  infoSize: 35,
  padding: 10
});

// Monochrome symbol (unfilled, single color)
var monoSymbol = new ms.Symbol("SHG-UCI----D", {
  size: 60,
  monoColor: "black"
});

// Symbol with engagement bar
var engSymbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  engagementBar: "A:123-45",
  engagementType: "TARGET"
});

Custom Options

Any additional properties added to the options object are preserved on the symbol and accessible via getOptions(). This makes it easy to attach application-specific metadata to a symbol object without losing it through option updates.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  uniqueDesignation: "ALPHA-6",
  // Custom application metadata — not used by milsymbol, but stored
  unitId: "unit-001",
  layerGroup: "friendly-ground"
});

var opts = symbol.getOptions();
console.log(opts.unitId);      // "unit-001"
console.log(opts.layerGroup);  // "friendly-ground"
This pattern is particularly useful when storing milsymbol options in a data store and round-tripping them back to recreate or update symbols without losing application data.

Build docs developers (and LLMs) love