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.

Text modifiers are standard-defined fields that appear around the symbol frame as labels. They carry critical operational information — unit identity, location, time, status, and more — and their positions relative to the symbol are specified by MIL-STD-2525 and STANAG APP-6. milsymbol renders all text modifiers automatically once you set them as options; the library handles placement, sizing, and bounding-box expansion so the symbol canvas always has room for all the text that has been supplied.

Field Codes and Character Limits

Each text modifier corresponds to a named field in the standard documents. The field codes are referenced in the option descriptions to help cross-reference with the original standard. Character limits are enforced by the standard documents — exceeding them may truncate display or violate interoperability requirements.
Field CodeOptionMax Characters
Field TuniqueDesignation21
Field MhigherFormation21
Field C / Rquantity9
Field Wdtg16
Field Ylocation19
Field GstaffComments20
Field HadditionalInformation20
Field Vtype24
Field Zspeed8
Field XaltitudeDepth14
Field KcombatEffectiveness5
Field FreinforcedReduced3
Field JevaluationRating2
Field Nhostile3
Field PiffSif5
Field AAspecialHeadquarters9
Field AFcommonIdentifier
Field ACcountry
Field Qdirection— (degrees)
Keep text values within the character limits defined in MIL-STD-2525/APP-6 for standard compliance and to ensure labels fit cleanly around the symbol without overlap. milsymbol expands the bounding box to accommodate the text, but overly long strings will simply render as provided.

Common Text Modifiers

uniqueDesignation — Field T

The unique designation is the most frequently used modifier. It identifies a specific unit, track, or piece of equipment. For ground units it appears to the lower-left of the symbol frame.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  uniqueDesignation: "1-68 AR"
});

higherFormation — Field M

Displays the parent unit or command. Corps are designated by Roman numerals per doctrine.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  uniqueDesignation: "1-68 AR",
  higherFormation: "3ID"
});

quantity — Field C / R

For equipment symbols, indicates the number of items present. Appears above the symbol frame.
var symbol = new ms.Symbol("SFE-AAAA---D", {
  size: 60,
  quantity: "12"
});

reinforcedReduced — Field F

Standard shorthand for unit strength: (+) reinforced, (-) reduced, (±) both.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  reinforcedReduced: "(+)"
});

dtg — Field W

Date-time group in the format DDHHMMSSZMONYYYY, or "O/O" for on-order.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  dtg: "30140000ZSEP97"
});

location — Field Y

Displays the symbol’s geographic location in degrees/minutes/seconds, UTM, or another applicable format.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  location: "0900000.0E570306.0N"
});

staffComments — Field G

Free-text staff comments; content is implementation-specific.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  staffComments: "FOR REINFORCEMENTS"
});

additionalInformation — Field H

Additional free-text information; content is implementation-specific.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  additionalInformation: "ADDED SUPPORT FOR JJ"
});

type — Field V

Indicates the type of equipment.
var symbol = new ms.Symbol("SFE-AAAA---D", {
  size: 60,
  type: "MACHINE GUN"
});

speed — Field Z

Velocity as set forth in MIL-STD-6040.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  speed: "035KTS"
});

altitudeDepth — Field X

Altitude flight level, submerged depth, or structure height.
var symbol = new ms.Symbol("SFAP---------", {
  size: 60,
  altitudeDepth: "FL240"
});

combatEffectiveness — Field K

Indicates unit effectiveness (up to 5 characters).
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  combatEffectiveness: "C2"
});

Full Example — Rich Symbol with Many Text Fields

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",
  uniqueDesignation: "2FSSB",
  higherFormation: "XVIII ABN",
  combatEffectiveness: "C1"
});

document.getElementById("symbolContainer").appendChild(symbol.asCanvas());

Controlling Text Field Display

infoFields — Toggle rendering

Setting infoFields: false prevents all text modifiers and the direction indicator from being rendered, while keeping the data stored on the symbol. This is useful when you want to build a symbol with all available operational data but render it compactly on a map at small scale, or toggle label visibility interactively.
// Symbol with data but no labels rendered
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 30,
  uniqueDesignation: "1-68 AR",
  higherFormation: "3ID",
  dtg: "30140000ZSEP97",
  infoFields: false   // suppress rendering
});

// Later, enable rendering without re-supplying the data
symbol.setOptions({ infoFields: true });

infoSize — Control text scale

The infoSize option controls the size of text modifier labels relative to the symbol size. The value is a percentage-like number: 40 means 40% of the default size of 100. Increase it for larger labels, decrease it for more compact output.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  uniqueDesignation: "1-68 AR",
  infoSize: 30   // smaller labels
});
Use infoColor to set the color of text modifier fields, and infoBackground / infoBackgroundFrame to add colored backgrounds behind the label groups for improved legibility. See the Style Options guide for details.

Movement Indicators

direction — Direction of movement arrow

Set direction to a bearing in degrees (0 = north, 90 = east, 180 = south, 270 = west) to render a movement indicator arrow. Set it to undefined to remove the arrow.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  direction: 45   // northeast
});
For ground units without a headquarters staff, the arrow attaches to the bottom of the symbol frame. For headquarters symbols, it attaches to the base of the HQ staff.

speedLeader — Speed leader line

When both direction and speedLeader are set, milsymbol draws a speed leader line instead of a movement arrow. The speedLeader value is the length of the line in pixels, independent of the symbol size.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  direction: 135,    // southeast
  speedLeader: 80    // 80-pixel leader line
});

Engagement Bar

The engagement bar appears above the symbol and displays information about a track’s engagement status. Use engagementBar for the text content and engagementType for the color-coded bar type.
var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  engagementBar: "A:123-45",
  engagementType: "TARGET"   // red bar
});
Valid values for engagementType:
ValueBar Color
"TARGET"Red (rgb(255, 0, 0))
"NON-TARGET"White (rgb(255, 255, 255))
"EXPIRED"Orange (rgb(255, 120, 0))

SIGINT Modifiers

SIGINT symbols carry additional specialized modifiers that indicate signal intelligence information.

sigint — Mobile/Static/Uncertain

var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  sigint: "M"   // M = Mobile, S = Static, U = Uncertain
});

platformType — ELNOT or CENOT

var symbol = new ms.Symbol("SFG-UCI----D", {
  size: 60,
  platformType: "ELNOT"
});

signatureEquipment — Electronic signature indicator

A single "!" character indicates detectable electronic signatures on hostile equipment.
var symbol = new ms.Symbol("SHG-UCI----D", {
  size: 60,
  signatureEquipment: "!"
});

Build docs developers (and LLMs) love