Cesium renders a 3D globe where geographic positions are expressed as longitude, latitude, and optional altitude. Point features are displayed using 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.
billboard property of an entity or through a BillboardCollection. Both accept an image that can be a URL or Base64 data URL — exactly what milsymbol’s toDataURL() provides.
The milsymbol repository does not include a Cesium example file. The patterns on this page are general integration guidance based on milsymbol’s output API and Cesium’s billboard API. Refer to the Cesium documentation for the most current Cesium API details.
Correcting the anchor with pixelOffset
Cesium billboards are centered on their position by default — the image center sits on the cartographic coordinate. milsymbol’sgetAnchor() returns the pixel offset from the top-left of the image to the geographic anchor point. To make that anchor point fall on the Cesium position you need to shift the billboard so that the anchor aligns with the origin.
Cesium’s pixelOffset uses screen-space coordinates where positive Y is up. The formula to convert milsymbol’s top-left-relative anchor into a Cesium pixel offset is:
Basic entity billboard
The simplest way to add a milsymbol symbol to Cesium is throughviewer.entities.add with a billboard property:
Adding multiple units from GeoJSON
This illustrative pattern iterates over GeoJSON features and creates a Cesium entity for each one, applying anchor correction:Using BillboardCollection for large datasets
When placing hundreds or thousands of symbols,Cesium.BillboardCollection is more efficient than individual entities:
High-DPI PNG output
For sharper symbols on retina displays, render the milsymbol canvas at a higher resolution and convert it to a data URL directly from the canvas object:The
square: true option in milsymbol forces all symbols to the same bounding box dimensions regardless of echelon or text fields. This simplifies anchor calculations for collections where you want uniform sizing but loses the echelon-proportional sizing that the standard recommends.