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
| Option | Type | Default | Description |
|---|
sidc | String | '' | 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).
| Option | Type | Default | Description |
|---|
additionalInformation | String | '' | A text modifier for units, equipment, and installations; content is implementation specific. Field H — 20 characters |
altitudeDepth | String | '' | Displays altitude flight level, depth for submerged objects, or height of equipment/structures on the ground. Field X — 14 characters |
auxiliaryEquipmentIndicator | String | '' | Auxiliary equipment indicator modifier. |
installationComposition | String | '' | Installation composition modifier. Field AI |
combatEffectiveness | String | '' | Indicates unit effectiveness or installation capability. Field K — 5 characters |
commonIdentifier | String | '' | Common name identifier, e.g. "Hawk" for the Hawk SAM system. Field AF |
country | String | '' | Three-letter country code. Field AC |
direction | Number | undefined | Direction of movement in degrees (0–360). Set to undefined to remove the direction arrow. Field Q |
dtg | String | '' | Date-time group in format DDHHMMSSZMONYYYY or "O/O" for on order. Field W — 16 characters |
engagementBar | String | '' | Engagement bar text, arranged as A:BBB-CC. Field AO |
engagementType | String | '' | Engagement bar type — one of "TARGET", "NON-TARGET", or "EXPIRED". Controls the bar fill color. |
equipmentTeardownTime | String | '' | Equipment teardown time in minutes. Field AE |
evaluationRating | String | '' | One-letter reliability rating and one-number credibility rating. Field J — 2 characters |
guardedUnit | String | '' | Unit designated as guarded during ballistic missile defence. Field AQ — 2 characters |
headquartersElement | String | '' | Headquarters element indicator, e.g. "TOC" for Tactical Operations Centre. Field AH |
higherFormation | String | '' | Number or title of higher echelon command (corps designated by Roman numerals). Field M — 21 characters |
hostile | String | '' | Letters "ENY" denoting hostile equipment symbols. Field N — 3 characters |
iffSif | String | '' | IFF/SIF identification modes and codes. Field P — 5 characters |
location | String | '' | Symbol location in degrees/minutes/seconds, UTM, or other applicable format. Field Y — 19 characters |
platformType | String | '' | "ELNOT" or "CENOT". Field AD |
quantity | String | '' | Number of items present in an equipment symbol. Field C or Field R — 9 characters |
reinforcedReduced | String | '' | (+) for reinforced, (-) for reduced, (±) for both. Field F — 3 characters |
sigint | String | '' | "M" = Mobile, "S" = Static, "U" = Uncertain. Field R2 |
signatureEquipment | String | '' | "!" indicates detectable electronic signatures for hostile equipment. Field L — 1 character |
specialDesignator | String | '' | Special track designators such as Non-Real Time (NRT) or Tactically Significant (SIG). Field AR — 3 characters |
specialHeadquarters | String | '' | Name of special C2 Headquarters — rendered inside the frame. Field AA — 9 characters |
speed | String | '' | Velocity as set forth in MIL-STD-6040. Field Z — 8 characters |
speedLeader | Number | 0 | Length of the speed leader line in pixels, independent of symbol size. |
staffComments | String | '' | Staff comments; content is implementation specific. Field G — 20 characters |
type | String | '' | Indicates type of equipment. Field V — 24 characters |
uniqueDesignation | String | '' | Uniquely identifies a particular symbol, track number, or SIGINT acquisition number. Field T — 21 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.
| Option | Type | Default | Description |
|---|
alternateMedal | Boolean | false | Use alternate MEDAL icons for mine warfare symbols instead of the default MEDAL icons (MIL-STD-2525D). |
civilianColor | Boolean | true | Use purple as the optional color for civilian symbols as specified in 2525C. |
colorMode | ColorMode 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(...). |
fill | Boolean | true | Whether the symbol is filled with color. |
fillColor | String | '' | Directly override the fill color of the symbol with any CSS color string. |
fillOpacity | Number | 1 | Opacity of the symbol fill color (0–1). |
fontfamily | String | 'Arial' | Font family for all text fields surrounding the symbol. |
frame | Boolean | true | Whether the symbol has a frame. All symbols support unframed rendering. |
frameColor | ColorMode | false | Override the color of the symbol frame. |
hqStaffLength | Number | undefined | Override the global headquarters staff line length for this symbol. |
icon | Boolean | true | Whether the symbol has an icon drawn inside the frame. |
iconColor | ColorMode | false | Override the color of the symbol icon. |
infoBackground | ColorMode or String | '' | Background color drawn behind text modifier fields. |
infoBackgroundFrame | ColorMode or String | '' | Stroke color for the border of the text modifier background area. |
infoColor | ColorMode or String | Same as frame outline | Color used for text in the modifier fields surrounding the symbol. Accepts a ColorMode object or a CSS color string. |
infoFields | Boolean | true | If false, text fields and direction are not rendered even if set, allowing you to store modifier data without displaying it. |
infoOutlineColor | String or false | rgb(239, 239, 239) | Color of the outline drawn around text fields, or false to fall back to outlineColor. |
infoOutlineWidth | Number or false | false | Width of the outline drawn around text fields, or false to fall back to outlineWidth. |
infoSize | Number | 40 | Size of the text fields relative to symbol size. 40 means 40% of the default size of 100. |
monoColor | String | '' | CSS color string. When set, the symbol renders as monochrome and unfilled using this color. |
outlineColor | ColorMode or String | rgb(239, 239, 239) | Color of the outline drawn around all symbol parts. Defaults to off-white. |
outlineWidth | Number | 0 | Width of the outline drawn around all symbol parts. 0 means no outline. |
padding | Number | 0 | Extra whitespace added around the symbol bounding box in pixels. |
size | Number | 100 | The L value — the width of the icon octagon in pixels. |
simpleStatusModifier | Boolean | false | Use simplified dashed-line status modifiers. This is the default for unfilled symbols and can be forced on filled symbols. |
square | Boolean | false | Output the symbol as a square with the insertion point at the center. |
stack | Number | 0 | Number of additional unit copies to stack behind the main symbol. 0 = one unit, 3 = four units total. |
standard | String | '' | Override the global standard for this symbol: "2525" or "APP6". |
strokeWidth | Number | 3 | Stroke 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.