Markup
Markup is the set of text boxes, callouts, lines, shapes and sections drawn over a scene in Navigator. A bookmark keeps its own markup within its settings, and a Project View can hold markup shared across its bookmarks.
Markup records store markup on its own, outside of any bookmark. Today they hold the templates in Navigator's markup panel, which users save from one element and reuse across bookmarks and Project Views.
This article will cover how to manage Markup records and how a template is laid out. The markup content itself, and where each kind of markup is stored, is described in JSON: Markup.
Data model
Below is the core data model for a Markup record. You can manage a record without populating the content.
Templates
A template is a Markup record with "IsTemplate" set to true. Its content holds the element the user saved, which we call the lead element, followed by anything that has to travel with it. For example a callout box is saved with the line that points to it.
Elements are read in the order "divs", "vectors" then "cesiumObjects", and the first one found is the lead element. Lines that travel with a box reference it by id through their snaps, so keep those ids in step when writing a template by hand.
When a user places a template, each element is copied with a new id. The copies remember where they came from, so the template's look can be applied again later.
Applying a template to an element that is already placed copies its look, such as colours, borders and fonts, cell by cell. The element keeps its own position, size, text and rows. This works when the element has the same rows and cells as the template, or when the template has a single cell.
Here is a template holding a single box with a title row and a body row.
Requesting records
You can request a list of all Markup records or an individual one. Both include the markup content, so filter the list by "IsTemplate" when you only want templates.
Get a list of Markup records
Get Markup record by ID
Create and update records
You can create a record by performing a POST request to the same URL as the GET. If you specify the ID as '0' then it'll create a new record and return it. If you specify an existing ID then it'll update the record and return it.
When updating, only the properties you include are changed. The markup content is replaced as a whole, so send all of it rather than only the elements that changed.
Create or update Markup record
Delete a record
We don't provide any bulk deletion but you can delete by record ID. Deleting an ID that does not exist still succeeds.
Elements already placed from a deleted template are not removed. They keep their look but can no longer have the template applied again.