JSON: Markup
A Markup is a JSON object stored inside a Bookmark record. It describes a set of 2D screen overlays and 3D world annotations that are rendered on top of the Cesium viewer when the bookmark is activated.
Markups are composed of Divs (HTML text boxes and shapes), Lines (SVG connector / callout lines), and Cesium objects (polygons, polylines, circles drawn in 3D space). The most commonly used elements are Divs and Callouts (a Div + Line pair).
Markup files use the file extension ".bmarkup" but are actually JSON text files. They can be exported/imported from the Markup interface in Navigator.
Top-level structure
The root object carries arrays for each element category and records the original screen dimensions the markup was authored against. The renderer scales elements proportionally when the viewer is a different size.
Base element
Every markup element (divs, lines, cesium objects) extends a common base that carries an id and optional metadata. The id must be unique within the markup and is used for cross-referencing (e.g. a line snapping to a div).
Div
A Div is the primary building block. It renders as an absolutely-positioned HTML box on the viewer overlay. Divs are used for text boxes, info panels, image tiles, and callout labels.
Sizing
The div itself has a fixed pixel width and height. Inside the div, content is laid out as rows. Each row has a height expressed as a percentage of the div height (all row heights should add up to 100). Within a row, each cell has a width expressed as a percentage of the row width (all cell widths in a row should add up to 100). For example, two equal columns in a single row would each have width: 50.
Anchoring & positioning
The position field controls how the div is anchored to the screen. It determines which corner of the viewport the div's coordinates are measured from:
| Position | Coordinates | Description |
|---|---|---|
TopLeft | left, top | Measured from the top-left corner. This is the default. |
TopRight | right, top | Measured from the top-right corner. |
BottomLeft | left, bottom | Measured from the bottom-left corner. |
BottomRight | right, bottom | Most commonly used anchor. The bottom-right area typically has the most available space. A typical offset is right: 120, bottom: 12. |
"fixed" | The div is not shifted by UI panel offsets (sidebars, toolbars). |
When the viewport resizes, the renderer recalculates the div position relative to its anchor corner so it stays in the intended screen region. Divs anchored to BottomRight will stay pinned to the bottom-right regardless of window size.
Colours
All colour fields (backgroundColor, fontColor, borderColor, etc.) accept standard CSS colour strings, hex (#1d70e7), rgba(29,112,231,0.75), or named colours.
Row & cell
Div content is a list of rows. Each row contains cells. Row heights and cell widths are percentages that should each total 100 within their parent.
Callout
A Callout is not a separate element type, it is a Div with type: "callout" paired with a Line whose end-snap references the div's id. The line's start-snap holds a 3D world position (the anchor point in the scene), and its end-snap attaches to a side of the div. This is what makes the callout "float" in 3D space, the line projects from a real-world coordinate to the screen-space div.
Common defaults: the line is typically white with brushSize: 3 and angled: true. The div usually has a semi-transparent background like rgba(29,112,231,0.75) with white text.
Line
A Line is an SVG-based vector rendered on the 2D overlay. Lines can connect two screen positions, two 3D world positions, or snap to divs. When a snap references a div id, the line end follows that div as it moves.
Free-paint
A free-form SVG stroke drawn on the overlay. Unlike lines, free-paints do not have snap anchors.
Polygon
A filled polygon rendered in 3D world space via Cesium. Positions are Cartesian3 or Cartographic (degrees) coordinates.
Polyline
A line rendered in 3D world space via Cesium. Similar to polygon but renders as a stroke.
Circle
A filled circle rendered in 3D world space via Cesium.
Cell actions
Each cell in a div row can have an optional action that fires when clicked.
Example: Colour legend
A common use case is a draggable colour legend anchored to the bottom-right of the viewer. The example below shows a single div with a title row and six category rows, each pairing a label cell with a colour swatch cell.