milsymbol provides extensive control over symbol appearance through its style options. You can produce filled or unfilled symbols, framed or unframed symbols, choose from built-in color modes or define your own, add outlines for map legibility, adjust sizes and padding, and fine-tune every text element. Style options can be mixed freely with modifier options and are passed through the same options object to theDocumentation 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.
Symbol constructor or setOptions().
Fill, Frame, and Icon
Three boolean options independently control the three core visual layers of a symbol: the frame shape, the fill color inside the frame, and the icon drawn on top.| Option | Type | Default | Description |
|---|---|---|---|
fill | Boolean | true | Fill the symbol frame with its affiliation color. |
frame | Boolean | true | Draw the symbol frame shape. |
icon | Boolean | true | Draw the symbol icon inside the frame. |
fill: false produces an unfilled (outline-only) symbol. Setting frame: false renders only the icon, useful for custom overlays. Setting all three to false produces a blank bounding box.
When
fill is false, milsymbol automatically uses simplified dashed-line status modifiers. You can also force this behavior on filled symbols with simpleStatusModifier: true.Size and Padding
size
The size option sets the L value — the width of the icon octagon in pixels. The default is 100, which makes the octagon 100 px wide. All other symbol dimensions (frame, text, staff lengths) scale proportionally.
padding
milsymbol normally fits the bounding box as tightly as possible around the symbol (including text modifiers). Use padding to add extra whitespace around the symbol when you need a consistent margin for map icons or icon arrays.
square
When square is true, the symbol is output as a square image with the insertion point at the center of the square. This simplifies placement in systems that expect square icons.
Color Control
colorMode
The primary color control for the symbol. Pass a registered color mode name or a ColorMode object. milsymbol ships with the following built-in color modes:
| Name | Description |
|---|---|
"Light" | Light fill colors (default) |
"Medium" | Medium fill colors |
"Dark" | Dark fill colors |
"FrameColor" | Frame colors for unfilled symbols |
"IconColor" | Icon colors for unfilled/unframed symbols |
"Black" | All black |
"White" | All white |
"OffWhite" | Off-white (used for white icon parts) |
"None" | Transparent (turns colors off) |
fillColor
Directly override the fill color with any CSS color string, bypassing the color mode entirely. Useful for quick one-off customization.
fillOpacity
Controls the opacity of the fill color (0 = transparent, 1 = fully opaque).
monoColor
Renders the symbol as monochrome and unfilled using a single color. Overrides color mode, fill, and icon colors.
Frame and Icon Colors
These options override the colors for individual visual layers, independently of the fill color mode.frameColor
Override the color of the frame shape using a ColorMode object.
iconColor
Override the color of the icon using a ColorMode object or a CSS string.
Outlines
Outlines improve legibility on complex map backgrounds by drawing a contrasting halo around all symbol parts. By default the outline is disabled (outlineWidth: 0).
outlineWidth and outlineColor
outlineColor defaults to rgb(239, 239, 239) (off-white) and accepts either a CSS color string or a ColorMode object.
Text Styling
These options control the appearance of text modifier fields rendered around the symbol.| Option | Type | Default | Description |
|---|---|---|---|
infoColor | ColorMode or String | Same as frame outline | Color of the text modifier labels. |
infoBackground | ColorMode or String | '' | Background color behind text modifier groups. |
infoBackgroundFrame | ColorMode or String | '' | Stroke color for the border of text modifier backgrounds. |
infoOutlineColor | String or false | rgb(239, 239, 239) | Outline color for text modifier labels. Pass false to inherit outlineColor. |
infoOutlineWidth | Number or false | false | Outline width for text modifier labels. Pass false to inherit outlineWidth. |
infoSize | Number | 40 | Label size as a percentage of the default symbol size (100). |
fontfamily | String | 'Arial' | Font family for all text modifier labels. |
Stroke Width
strokeWidth controls the stroke width for all symbol path elements (frame, icon, HQ staff, etc.). The default is 3.
Status Modifier
By default, milsymbol renders the standard status modifier for anticipated/planned/pending symbols using a dashed frame. SettingsimpleStatusModifier: true forces simplified dashed-line indicators on filled symbols as well.
Stack
Display a unit stack to convey that multiple units occupy the same position. Thestack number is the count of additional units shown behind the main symbol (0 = one unit total, 3 = four units total).
HQ Staff Length
For headquarters symbols, the HQ staff extends below the symbol frame. UsehqStaffLength to override the global default for a specific symbol. To set the global default for all HQ symbols, use ms.setHqStaffLength(length).
Standard
Thestandard option overrides the global standard (set with ms.setStandard()) for a single symbol. Use "2525" for MIL-STD-2525 rendering and "APP6" for STANAG APP-6 rendering. Where the two standards differ, this option selects which version to use.
Alternate MEDAL
For mine warfare symbols, MIL-STD-2525D defines both MEDAL and alternate MEDAL icons. milsymbol uses MEDAL icons by default. SetalternateMedal: true to switch to the alternate version.
