milsymbol exposes a small set of global configuration functions that control behavior shared across all subsequently created symbols. These settings act as global defaults — for example, the active military standard (MIL-STD-2525 vs. STANAG APP-6), the pixel length of headquarters staff lines, and the SVGDocumentation 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.
stroke-dasharray patterns used for pending, anticipated, and feint/dummy status modifiers. Individual symbols can override some of these values through their own options (e.g. hqStaffLength and standard), but the global settings provide the baseline for any symbol that does not specify its own.
ms.setStandard()
Sets the preferred military symbology standard used when rendering symbols. APP-6 (NATO) and MIL-STD-2525 (US) occasionally differ in how certain symbols are drawn; this function selects which convention milsymbol follows by default.The standard to activate. Use
"2525" for MIL-STD-2525 (default) or "APP6" for STANAG APP-6.true if the standard was set successfully, false otherwise.
All SIDCs will always produce some symbol regardless of which standard is active. The setting only affects symbols where APP-6 and 2525 genuinely differ in their visual output. Individual symbols can also override the global setting by passing
standard: "2525" or standard: "APP6" in their options.Example
ms.getVersion()
Returns the current version string of the loaded milsymbol library.string with the semantic version, e.g. "2.2.0".
Example
ms.getHqStaffLength() / ms.setHqStaffLength()
Headquarters symbols include a vertical staff line extending below the symbol frame. These functions read and write the global pixel length of that staff line.ms.getHqStaffLength()
number.
ms.setHqStaffLength()
The desired staff length in pixels. This value is applied to the symbol coordinate system where the icon octagon is 100 units wide.
number.
Example
ms.getDashArrays() / ms.setDashArrays()
Pending, anticipated, and feint/dummy symbol modifiers are rendered with dashed SVG strokes. These functions read and write thestroke-dasharray string used for each status type.
ms.getDashArrays()
DashObject:
ms.setDashArrays()
The SVG
stroke-dasharray value for symbols with Pending status (e.g. "4,4").The SVG
stroke-dasharray value for symbols with Anticipated status (e.g. "8,12").The SVG
stroke-dasharray value for the Feint/Dummy modifier (e.g. "8,8").DashObject with all three values set.
Example
ms.outline()
A utility function that takes one or more draw instructions and returns stroke-only (outline) versions of them. All fill properties are removed and the stroke is widened to create a halo or outline effect. This is useful for adding contrast behind symbol parts — for instance, rendering a white outline behind dark icon lines on a complex map background.ms.outline() is a JavaScript-only internal utility. It is not included in the TypeScript type declarations (index.d.ts) and has no exported type signature. It is available at runtime on the ms namespace object but will not be recognised by TypeScript’s type checker.The draw instruction(s) to convert into outline form. Accepts both a single
DrawInstruction object and an array of them.The width (in pixels, in symbol coordinate space) to add around each existing stroke. The new total stroke width will be
originalStrokeWidth + 2 * outline.The original stroke width of the draw instructions, used as the baseline when computing the enlarged outline stroke width.
The CSS color string to use for the outline stroke (e.g.
"white", "rgb(239,239,239)").Array or Object of draw instructions that render only the outline stroke, with fills removed.
