Map documents

A Sarkoa map document is a JSON description of a custom map: camera, basemap, access settings, and every layer style. The same document works with the CLI, MCP, and the web map builder.

Current version: sarkoa.com/maps/v1

Minimal example

Replace the example assetId with a processed file in your organization before saving this document. Comments and annotations are explicitly disabled so the example does not require collaboration features.

{
  "apiVersion": "sarkoa.com/maps/v1",
  "kind": "Map",
  "metadata": {
    "title": "Earthquake impacts",
    "description": "Vector and raster layers for response planning",
    "category": null,
    "tags": ["earthquake"]
  },
  "spec": {
    "view": {
      "centerLng": -74.1,
      "centerLat": 4.65,
      "zoom": 9,
      "preferredMapMode": "2d",
      "preferredProjection": "mercator"
    },
    "basemap": {
      "basemapId": "default-osm-basemap",
      "mapTheme": "default",
      "overlays": { "labels": "over", "roadsAndRail": "under", "boundaries": "under", "hillshade": "hidden" },
      "buildings3d": false
    },
    "chrome": { "version": 1, "layersPanel": "visible", "searchBar": "visible" },
    "legends": {
      "version": 1,
      "panel": "visible",
      "placement": "bottom-right",
      "collapsible": true,
      "defaultCollapsed": false,
      "order": []
    },
    "interactions": { "version": 1, "interactions": [] },
    "access": {
      "accessMode": "organization",
      "allowedUserIds": [],
      "allowedEmails": []
    },
    "collaboration": {
      "commentsEnabled": false,
      "annotationsEnabled": false,
      "commentsAudience": "inherit",
      "annotationsAudience": "inherit",
      "commentAllowedUserIds": [],
      "annotationAllowedUserIds": []
    },
    "downloads": {
      "downloadsEnabled": false,
      "downloadsAudience": "inherit",
      "downloadAllowedUserIds": [],
      "downloadAllowedEmails": []
    },
    "uploads": {
      "uploadsEnabled": false,
      "uploadsAudience": "inherit",
      "uploadAllowedUserIds": [],
      "uploadAllowedEmails": []
    },
    "layers": [
      {
        "layerId": "faults",
        "assetId": "11111111-1111-4111-8111-111111111111",
        "visible": true,
        "downloadable": false,
        "vectorStyle": {
          "mode": "simple",
          "fillColor": "#35605A",
          "fillOpacity": 0.35,
          "strokeColor": "#d13c3c",
          "strokeOpacity": 1,
          "strokeWidth": 2,
          "labelField": null
        }
      }
    ]
  }
}

Layer styles

Vector

  • simple: solid fill and outline colors, opacity, stroke width, optional label field

  • categorized: color classes from an attribute (up to 50 classes). Use a distinct palette (default) so neighbouring classes stay easy to tell apart, or Category 10 / colour-blind-safe (Okabe-Ito). Shuffle the colours in the layer style editor, with sarkoa map layer classify --shuffle, or with MCP classify_vector_style (shuffle / seed). Optional palette and paletteSeed are stored on the style.

  • graduated: numeric class breaks with a color ramp (equal interval, quantile, jenks, or manual). Set normalizeBy to divide the attribute by another field (a rate or a density), and normalizePer to multiply the result (100000 for a rate per 100,000, 100 for a percentage); breaks are then in that unit and the legend shows them as written

  • Continuous ramp (graduated): set unclassed: true to slide colour smoothly along the rampId ramp from breaks[0] to the last break instead of filling classes; values past either end take the end colour, and the legend is a bar labelled at the two ends. Add transform: "log" for amounts spread over several orders of magnitude (breaks[0] must then be above 0, and values at or below 0 take nullColor). Keep breaks and colors a valid classed style: an older reader draws that instead.

  • sizeBy (points and lines): scale point radius or line width from a numeric attribute, independently of colour. Set attribute, mode (proportional with domain/range, or graduated with breaks/sizes), and optional transform (sqrt by default for point-area scaling and compressed line widths, or linear for radius/width scaling). Polygons ignore it. In the layer style editor, open Size and pick the field.

  • strokeDash (lines and polygon outlines): solid (default), dashed, dotted, or dash-dot. Point outlines stay solid. In the layer style editor, this is Line pattern next to stroke width.

  • fillPattern (polygons): draw a pattern instead of the solid fill. The marks are drawn in the fill colour (each class's colour on a categorized or graduated layer) at the fill opacity, so fillOpacity: 0 hides them.

    "fillPattern": { "kind": "lines", "angle": 45, "spacing": 8, "size": 1 }
    
    • kind: lines, crosshatch (lines at angle and at right angles to it), dots, or stipple (scattered dots, like sand).
    • angle: whole degrees counter-clockwise from horizontal: 0 horizontal, 45 "/", 90 vertical, 135 "\". Lines take any angle whose pattern repeats within 256 px, which at the default spacing is everything at least 2° from horizontal or vertical (and 0 and 90 themselves); the error names the settings that work. Crosshatch and dots take 0 (a grid) or 45 (an "x", or staggered rows).
    • spacing: px between lines or dot centres, 3 to 64. size: line width or dot diameter, 0.5 to 8 px and at most half the spacing.
    • color (optional): one colour for the marks instead of the fill colour.
    • background (optional): { "color": "#F2E9D8", "opacity": 0.6 }, a flat colour behind the marks. Leave out color to use the fill colour as a wash, for example black hatching (color: "#111111") over a 30% tint of each class colour.

    A pattern keeps its size on screen rather than on the ground: between whole zoom levels the viewer draws it at 0.7 to 1.4 times the size you set, and printed maps draw it at exactly that size. In the layer style editor, open Fill pattern.

  • Patterns per class (polygons): a categorized class takes "pattern": { ... } (same keys as fillPattern, without color and background), or "pattern": null to stay solid; a graduated style takes patterns, one entry per colour. Classes without their own take the layer's fillPattern. Giving every class its own pattern lets the map be read without colour, on a black-and-white print or by a colour-blind reader: A different pattern for each class in the editor, or classify_vector_style with patterns: "distinct".

  • edgeBand (polygons): { "width": 6, "opacity": 0.4 }, a soft band of the fill colour just inside every edge, as on old atlases. width is 2 to 10 px.

Colors use #RRGGBB. Stroke width is 0.5–24. sizeBy radii are 0.5–100. Layer title values show in the layers list. Legend title applies to simple styles as well as categorized and graduated ones.

Each layer needs a layerId: a UUID or a short slug such as faults or layer-smoke (letters, numbers, _, -). Slugs are unique within a map (you can reuse the same slug on another map). Reference them from legends.order and interaction targets.

Layer order. spec.layers runs bottom to top: the first entry is drawn first and sits underneath everything after it, and the last entry is drawn on top. This is the reverse of the map builder's layers panel, which puts the topmost layer in its first row, so a document and the builder read the same stack in opposite directions. legends.order is separate and does run top to bottom, matching the legend panel.

Clickable legends. legends.interactive (default true) lets visitors hide a categorized or graduated class by clicking its legend row. Set it to false to keep the legend read-only. A continuous ramp (unclassed: true) has no classes to hide. A shared link carries the hidden classes in ?hide=<layerId>:<key>|<key>, where a key is = plus the class value, ~other, ~null, # plus a graduated class number (from 0), or ~nodata.

You can add the same file more than once. Give each copy its own layerId and style. Your personal colour preferences for that file still apply to every copy; map styles stay independent.

The sketch { "mode": "categorized", "attribute": "kind" } is not enough to paint the map. Saved styles need class colours: use Classify in the layer style editor, sarkoa map layer classify MAP LAYER --attribute kind, or MCP classify_vector_style. Those assign a distinct palette (or Category 10 / colour-blind-safe) you can shuffle.

To size points (or line width) by a number, add sizeBy next to the colour mode. inspect_asset.sizeChannel tells you whether the layer uses radius, width, or neither:

"vectorStyle": {
  "mode": "simple",
  "fillColor": "#35605A",
  "fillOpacity": 0.5,
  "strokeColor": "#312E81",
  "strokeOpacity": 1,
  "strokeWidth": 1,
  "labelField": null,
  "sizeBy": {
    "attribute": "capacity_mtpa",
    "mode": "proportional",
    "domain": [0.1, 80],
    "range": [3, 24],
    "transform": "sqrt"
  },
  "strokeDash": "dashed"
}

strokeDash only changes real line layers. Polygon outlines and point rings stay solid.

"layers": [
  {
    "layerId": "by-kind",
    "assetId": "11111111-1111-4111-8111-111111111111",
    "title": "Sites by type",
    "visible": true,
    "vectorStyle": {
      "mode": "categorized", "attribute": "kind", "applyTo": "both",
      "fillColor": "#35605A", "fillOpacity": 0.5,
      "strokeColor": "#312E81", "strokeOpacity": 1, "strokeWidth": 1,
      "labelField": null, "otherColor": "#999999",
      "classes": [
        { "value": "clinic", "color": "#0072B2" },
        { "value": "school", "color": "#E69F00" }
      ]
    }
  },
  {
    "layerId": "by-date",
    "assetId": "11111111-1111-4111-8111-111111111111",
    "title": "Sites by year",
    "visible": true,
    "vectorStyle": {
      "mode": "graduated", "attribute": "year", "applyTo": "both",
      "fillColor": "#35605A", "fillOpacity": 0.5,
      "strokeColor": "#312E81", "strokeOpacity": 1, "strokeWidth": 1,
      "labelField": null, "normalizeBy": null, "nullColor": "#999999",
      "method": "manual", "classCount": 2,
      "breaks": [2000, 2010, 2026], "colors": ["#56B4E9", "#0072B2"]
    }
  }
]

Feature popup (vector layers)

When popupConfig is enabled on a vector layer, clicking a feature opens an attribute panel. Set titleField for the heading and fields for the rows to show. A popup shows at most 12 fields; send more and the extras are dropped with a popup_fields_truncated warning, so put the ones you need earliest. Do not repeat titleField inside fields: it renders as the heading and is skipped in the body, so it would spend one of the twelve slots on a row nobody sees. Optional imageFields lists attribute names whose https:// values should render as thumbnails instead of plain text (useful for photo URLs stored in your data). Thumbnails show the whole image, including tall illustrations, rather than cropping to fill the popup.

"popupConfig": {
  "enabled": true,
  "titleField": "name",
  "fields": ["description", "photo_url"],
  "imageFields": ["photo_url"]
}

Charts

charts adds up to two charts above the rows, drawn from the clicked feature's own numeric attributes. Chart fields do not count against the 12, and a popup may have charts and no fields at all. Each chart takes a type, its fields in axis order (2 to 24 numeric attributes, at most 8 for composition), and optionally a title, xLabels, format and yDomain.

type use it for notes
bar a value per year or per category bars always start at zero; numeric labels draw as columns, words as horizontal bars
line one quantity over ordered steps a missing value leaves a gap rather than dropping to zero; when the field names carry years or dates (pop_1975, ndvi_2024_06), points sit at their real time, so 1975, 2020 and 2030 are not drawn as equal steps
composition parts of one whole one stacked bar with each part's share; parts must not be negative

On a map with a time slider, a line or bar chart whose field names carry years or dates follows the slider: a marker shows the selected time, with a solid dot and the value on a data year, a hollow dot between data years (where the time falls, without inventing a value), a shaded band when the slider selects a range, and the selected column highlighted on bars. Set "timeMarker": "off" to keep a chart still.

On the same charts, readers can hover, tap or use the arrow keys to read each point's exact value. With a mouse, clicking a point moves the time slider to that point's year; on a phone the tooltip offers "Show 2020 on the map", and on a keyboard Enter does the same. Set "seekOnClick": "off" to keep reading without moving the map.

Units. popupConfig.fieldUnits gives a field a unit, written before and/or after its value: { "pop_2020": { "suffix": " people" }, "price": { "prefix": "$" } }. Each part is kept exactly as written (include the space in " people") and is at most 12 characters. Rows show it on their values, and a chart shows the unit that all its fields share. A chart can set its own prefix and suffix instead. On the axis, a short suffix such as °C appears on every tick and a longer one such as " people" appears once above the axis. If a chart's fields have different units and the chart sets none, it shows no unit and you get a popup_chart_mixed_units warning.

Projections and marked periods. A chart over time shades the map's own marked periods (spec.temporal.markers, such as "Projections 2025 to 2030") and names them under the chart; set "periods": "off" to leave them out. Set "projectedFrom" to the first projected field and the line turns dashed into it, projected points are drawn hollow, projected columns are lighter, and their values read "(projected)".

Compared with the rest of the layer. Set "compare": "layer" and each point gets the layer behind it, taken from the layer's field stats: on a line, a band over the middle 80% of the layer's features (10th to 90th percentile) with a dotted line at the median; on columns, a whisker over the same range with a tick at the median. Below 10 features the band covers the full range instead, and the key under the chart says which. The values table gains a median column and the tooltip adds the median beside the value. The band describes how each year is spread across the layer, not the path of a typical feature. It is for lines and for columns over years or other ordered labels, not for composition or bars over categories. Some older layers have no sample of their values in their stats; their charts are drawn without the band.

yDomain is zero (the bar default), auto (the line default, fitted to each feature), layer (one scale for every feature in the layer, so popups can be compared), or a fixed [min, max]. The axis always widens to fit the feature's values, so no setting hides a value. auto is refused on bars, and composition has no value axis. format: "percent" reads values as fractions, like fieldFormats. Labels default to the part of the field names that varies: pop_2001 shows as 2001 and share_forest as Forest. Set xLabels to change them.

"popupConfig": {
  "enabled": true,
  "titleField": "name",
  "fields": ["population"],
  "charts": [
    { "type": "line", "title": "Population", "fields": ["pop_2001", "pop_2011", "pop_2021"], "yDomain": "layer" },
    { "type": "composition", "title": "Land cover", "fields": ["share_forest", "share_crop", "share_urban"], "format": "percent" }
  ]
}

A feature with fewer than two numeric values for a chart skips that chart, and the rest of its popup still shows.

Default view

spec.view.preferredMapMode is 2d (default) or 3d (terrain). spec.view.preferredProjection is mercator (flat map, default) or globe. These control how the map opens; visitors can still switch in the viewer.

Set them from the CLI with sarkoa map display MAP --mode 3d --projection globe, or from MCP with update_map (setView) or create_map / scaffold_map (preferred_map_mode, preferred_projection).

Which world a map is on

spec.celestialBody is moon, mars, venus, mercury, ceres, europa, ganymede, callisto, io or titan. Leave it out for Earth, which is the default and how every Earth document reads. Coordinates in spec.view are then planetocentric, east-positive longitude and latitude on that world. See Maps of other worlds.

"spec": {
  "celestialBody": "moon",
  "basemap": { "basemapId": "moon-lroc-wac" }
}

From MCP, scaffold_map takes celestial_body and fills in that world's default basemap. To change an existing map, update_map takes {"op": "setCelestialBody", "celestialBody": "moon"}, which also resets the basemap to the new world's default and turns 3D buildings off. A replace_map document that does not name a world keeps the one the map has.

Code Status When
celestial_body_mismatch 400 A layer's file is on a different world from the map, with one errors[] entry per layer at /spec/layers/{i}/assetId. Also a basemap from the wrong world, at /spec/basemap/basemapId
celestial_body_locked 409 Changing a map's world while it has layers. Remove them first, or start a new map. Naming the world the map is already on changes nothing and is not refused
celestial_body_unknown 400 Not one of earth, moon, mars, venus, mercury, ceres, europa, ganymede, callisto, io, titan

Map chrome

spec.chrome controls viewer UI chrome (version 1).

  • layersPanel: visible, collapsed, or hidden
  • searchBar: visible (default) or hidden. When visible, a search button on the map lets viewers find places, paste coordinates, search named features in visible vector layers, and jump to layers by name. Hide it on presentation-only maps where navigation is not needed.
  • geolocate: visible (default) or hidden. Shows a "find my location" button. The browser asks the viewer for permission only when they press it.
  • locator: hidden (default) or globe. Adds a small globe in a corner of the map that turns as the map moves and outlines the part of the world on screen. A view too small to outline shows as a dot, and below zoom 3, where the map already shows a continent or more, the outline fades out. Clicking the globe moves the map there. On maps 480 pixels wide or less, such as on phones, it starts folded into a button, and it is left out of maps smaller than 320 by 360 pixels.
  • locatorPlacement: bottom-left (default), top-left, or bottom-right. The corner the globe sits in.
  • starfield: hidden (default) or stars. Draws the real night sky behind the map's globe: every star you can see with the naked eye, from the Yale Bright Star Catalogue, and the Milky Way from NASA's Deep Star Maps. The sky is placed for the moment someone views the map and turns with the planet as they move it, so the stars past the edge of the globe are the ones really in that direction. On a dark page the stars are light, with the Milky Way; on a light page they are dark ink. It shows only on the globe projection and fades out as you zoom in past zoom 7.
  • globeSpin: off (default) or slow. Turns the globe slowly on its axis when the map opens, about once every two and a half minutes, the way the planet itself turns. It stops for good as soon as a visitor touches the map, scrolls or presses a key, or when anything else moves the view, such as a tour. It applies only to a map that opens on the globe, zoomed out far enough to see the planet, and without pan bounds. It stays still for visitors whose device asks for reduced motion, in print, and when a link opens the map at a view of its own (a shared position, a linked spot, a tour stop). Visitors can start it themselves on any globe from the menu that opens when they right-click or long-press the map: Spin the globe.

In the map builder, open Display to set the layers panel, search, location button, inset globe and its position. The night sky is under Default view for visitors, below the projection choice, and so is Spin the globe, which appears when the map opens on the globe. Live search stays disabled in editor mode.

From MCP, use update_map with setChrome, for example {"op": "setChrome", "chrome": {"locator": "globe", "locatorPlacement": "top-left"}}. Chrome settings you leave out stay as they are.

Layer attribution

Each layer can include attribution: { "text": "Source name", "url": "https://example.com" }. That credit appears in the bottom-right map attribution when the layer is on. Omit it to use the file’s stored credit, or set attribution to null to hide a credit on this map only.

From the CLI: sarkoa map layer add MAP --asset FILE --attribution-text "Source name" --attribution-url https://example.com. From MCP, pass attribution_text and attribution_url on create_map / scaffold_map layers, or updateLayer.patch.attribution.

Basemaps and themes

spec.basemap.basemapId is default-osm-basemap (Streets) or satellite-basemap (satellite imagery with the street map's labels, roads and boundaries over it). Where satellite is not switched on yet, a map saved with it shows Streets.

On another world basemapId is none or one of that world's hosted basemaps: moon-relief or moon-lroc-wac on the Moon, mars-relief or mars-viking-mdim on Mars, venus-magellan-fmap on Venus, mercury-relief on Mercury, ceres-relief or ceres-dawn-fc on Ceres, europa-galileo-voyager, ganymede-galileo-voyager, callisto-galileo-voyager and io-galileo-voyager on those moons of Jupiter, and titan-cassini-iss on Titan. Leave basemapId out and each world uses its default: Streets on Earth, Shaded Relief on the Moon, Mars, Mercury and Ceres, the radar mosaic on Venus, and the only hosted basemap on each of the other five. Earth takes neither none nor another world's basemaps.

spec.basemap.mapTheme must be one of: default, dark, forest, ocean, minimal-light, warm, satellite, minimal-dark. Unknown values are rejected (they are not silently rewritten). Themes colour the Streets basemap only. The theme id satellite is the colour scheme shown as Earth tones, not imagery.

Set mapTheme to null to use your organization's default theme instead, whatever it is when the map is viewed (this is Organization default in the map builder). Leaving mapTheme out means default.

spec.basemap.customThemeId is optional: the id of one of your organization's custom basemap themes (made under Organization settings, Basemap themes, Custom themes). When it is set, the map draws that theme and mapTheme is saved as the preset the theme is based on, so you can leave mapTheme as it is. Set it to null, or set mapTheme on its own in a setBasemap operation, to go back to a preset. An id that is not one of your organization's themes is dropped with a custom_theme_not_found warning, and the save goes ahead. To find the ids, use the MCP tool list_basemap_themes. Custom themes, like the presets, show on the Community plan and above.

Raster

  • bands: choose RGB band indexes
  • palette: a named ramp on a single-band raster
  • continuous: a named ramp stretched from vmin to vmax, your own colour stops, or colour classes, with an optional threshold that hides values outside a range

continuous colours the raw values of a single-band raster whose product kind is measurement (inspect_asset reports it as raster.productKind). Other rasters ignore it.

Named ramps

palette and ramp take the same names. Graduated vector styles (rampId) take them too.

Kind Names Good for
Sequential viridis, cividis, inferno, magma, plasma, turbo, ylorrd, ylgnbu Values that run from low to high
Single hue grayscale, reds, blues, greens, oranges, purples One quantity where low means little or nothing; the light end fades into the basemap
Diverging rdbu, rdylbu, brbg, spectral Departures either side of a midpoint, such as anomalies or change

The single-hue ramps run from near white to a dark colour (grayscale runs black to white). A diverging ramp puts its middle colour halfway between vmin and vmax, so centre the range on the midpoint you mean, for example -5 to 5 around zero.

Add "reverse": true to run a named palette or ramp the other way, high to low. rdbu puts red at the low end; reversed, it puts red at the high end, as most temperature maps do:

"rasterStyle": { "mode": "continuous", "ramp": "rdbu", "reverse": true, "vmin": -5, "vmax": 5 }

reverse does not apply to custom stops: reverse their colours instead and keep the values increasing. On a graduated vector style the colours are already listed in colors, and rampReverse only records that they were taken high to low.

Custom colour stops

When none of the named ramps fits, give stops instead of ramp: 2 to 64 colours, each at a data value in the raster's own units (metres, degrees, a percentage), with values strictly increasing. A diverging ramp centred on zero:

"rasterStyle": {
  "mode": "continuous",
  "stops": [
    { "value": -5, "color": "#2166AC" },
    { "value": 0, "color": "#F7F7F7" },
    { "value": 5, "color": "#B2182B" }
  ]
}
  • Colours use #RRGGBB. The map blends linearly between neighbouring stops, so two stops a small step apart (9.99 and 10) give a hard edge between classes.
  • ramp and stops cannot both be set.
  • With stops, the range is the first and last stop. Leave vmin and vmax out, or give exactly those two values; anything else is rejected, and the error names the stop it should match.
  • Values below the first stop take the first colour and values above the last stop take the last colour, as with a named ramp. Only no-data is transparent; to hide values outside a range, set a threshold.
  • A threshold hides values outside its range but never moves a stop. On a named ramp it also stretches the ramp over what is left.
  • The legend, on screen and in print, draws the stops at their values and labels the ends with the first and last stop.
  • The map builder and the layer style editor keep stops when you save (they show as Custom stops). Picking a named ramp there replaces them.

Colour classes

To read a raster in bands, one flat colour per range of values, give classes instead of ramp or stops. breaks are the class edges in the raster's own units, strictly increasing, one more than colors (three colours need four breaks). labels is optional:

"rasterStyle": {
  "mode": "continuous",
  "classes": {
    "breaks": [0, 10, 30, 80],
    "colors": ["#2E7D32", "#F9A825", "#C62828"],
    "labels": ["Stable", "Watch", "Moving"]
  }
}
  • 2 to 32 classes, colours as #RRGGBB. The edges between classes are hard: there is no blending.
  • A value on a break belongs to the class above it: with the breaks above, 10 is Watch.
  • Values below the first break take the first colour and values above the last break take the last colour, so the legend reads the end classes as "Under 10" and "30 or more". To hide values outside a range, set a threshold.
  • labels names each class in the legend; null (or leaving labels out) shows the class's range instead, with the legend's unit.
  • ramp, stops and classes are exclusive. With classes, the range is the first and last break: leave vmin and vmax out, or give exactly those values.
  • In the legend, visitors can click a class to hide it and click again to show it. The hidden classes go in the address (?hide=), so a shared link shows the same view. Clicking the map names the class under the pointer beside its value.
  • In the layer style editor, choose Classes in the Ramp list. Each row is a class: its colour, where it starts and ends, and a label. Add class, Colours from (recolour every class along a named ramp) and Equal classes (split the raster's range into that many classes of equal width) build the table quickly.
  • On a series with change, the change view still draws the change with a ramp; the classes apply to each date's own values.

Before choosing attribute names, categories, or value ranges, check what is actually in the file with inspect_asset (MCP) or the file details panel in the app. Guessing an attribute name is the most common reason a style comes back empty.

Interactions

Map-level controls live in spec.interactions (version: 1). The viewer shows them in the Filters panel.

Vector filters

Sliders and dropdowns target a vector layer and a feature property:

{
  "id": "range",
  "type": "slider",
  "label": "Range (mi)",
  "min": 50,
  "max": 300,
  "step": 50,
  "default": 150,
  "target": { "layerId": "ev-range", "assetId": "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa", "sublayers": "all" },
  "action": { "kind": "filter", "property": "range_bucket", "operator": "<=" }
}

Toggles switch vector sublayer visibility (action.kind: "visibility").

Raster thresholds

Sliders can threshold single-band measurement rasters that have raster_band_min and raster_band_max metadata. The layer should use rasterStyle.mode: "continuous". Viewers adjust the visible value range in real time; the slider position is not saved back to the map. Target the layer with assetId (the file) and, when the map uses a distinct layer id, layerId as well. Existing maps that only stored assetId still threshold the painted layer.

{
  "id": "depth",
  "type": "slider",
  "label": "Minimum depth",
  "min": 0,
  "max": 42,
  "step": 1,
  "default": 10,
  "target": { "layerId": "dem", "assetId": "11111111-1111-4111-8111-111111111111" },
  "action": { "kind": "rasterThreshold", "op": ">=", "outside": "hide", "band": 1 }
}

Supported operators: >= and <=. At the non-filtering edge (min for >=, max for <=), the control shows the full ramp (any static threshold in rasterStyle still applies).

Access modes

Mode Who can open the map
organization Members of your organization
specific_users Listed organization members
invited_emails People invited by email
public Anyone with the link can see the map and its same-organization layers; the source files do not have to be public
password Anyone with the link and password (Essential+)

Passwords are write-only. Exports and get_map never return the password value.

Maps do not use file visibility values (private, org, public_link). Change who can open a map with spec.access.accessMode, the CLI (sarkoa map access MAP --mode organization), or MCP update_map (setAccess). Public, password, and email-invite changes need --yes (CLI) or confirm_publish=true (MCP). A public or password map shows every layer on it to its visitors whatever the files' own visibility, and a save lists the layers it newly shows that way (map_exposes_layers warning); see Sharing and access.

Safe updates

Maps keep a revision number. When you change an existing map, send the revision you last read (--expected-revision in the CLI, or expected_revision in MCP/API). If someone else saved first, the server returns a conflict so you can reload and try again.

update_map checks every operation before it applies any. A key the operation does not read fails the whole call with invalid_operations and an errors[].path naming it, and nothing is saved. The usual slips are a block written one level too high (setAccess with accessMode instead of access: { accessMode }) or one level too deep (setMetadata with metadata: { title } instead of title). The snake_case spellings the document accepts, such as access_mode, work inside an operation too.

  • CLI: sarkoa map commands
  • MCP: agent tools for map authoring
  • Maps of other worlds: the Moon, Mars, Venus, Mercury, Ceres, Europa, Ganymede, Callisto, Io and Titan
  • Web app: visual map builder

Warnings

validate_map, create_map and replace_map return valid: true alongside a warnings array when part of a document could not be used, and update_map returns the same array (dry runs included). Nothing failed, and nothing was written for those keys either. Each warning carries a path (a JSON pointer into the document), a message, and a code:

code what it means
unknown_vector_style_key a vectorStyle key the parser does not recognise; it was dropped
unknown_raster_style_key a rasterStyle key that mode does not read; it was dropped
popup_fields_truncated more than 12 popup fields were sent; the extras were dropped
popup_field_dropped one popup field was unusable or duplicated
popup_image_field_dropped an imageFields entry is not in fields, or is the titleField
popup_title_field_in_fields titleField is repeated in fields, wasting a slot on a row that never renders
popup_chart_dropped a chart was unusable (unknown type, fewer than two fields) or past the limit of two; it was dropped
popup_chart_field_dropped a chart field was unusable, or past the chart's field limit
popup_chart_option_dropped a chart's title, xLabels entry, format or yDomain was invalid, or the chart had a key it does not read (such as y_domain for yDomain); the chart kept its defaults
unknown_popup_key a popupConfig key the parser does not recognise; it was dropped
popup_field_unit_dropped a fieldUnits entry was invalid, or names a field no row or chart shows
popup_chart_mixed_units a chart's fields have different units and the chart sets no prefix or suffix, so it shows none
unknown_legend_ref a legends.order entry names no layer on the map
unknown_layer_ref / unknown_asset_ref an interaction targets a layer or asset the map does not have
dropped_layer_config a replace_map document omitted a popupConfig or legend the layer had, so it was removed
static_raster_on_temporal_map a static raster sits on a map with a time scrubber
overlapping_visible_layers two or more filled layers (polygons or rasters) cover the same area and are all switched on when the map opens, so only the top one can be read. Keep the one the map is about on and set visible: false on the others
layer_id_defaulted a layer had no layerId, so one was generated
description_truncated the description ran past 4,000 characters and the tail was cut
category_truncated the category ran past 40 characters and was cut
tag_truncated a tag ran past 40 characters and was cut
layer_title_truncated a layer title ran past 200 characters and was cut
buildings3d_earth_only buildings3d was set on a map on another world, where it is off

Read them. They exist because each of these used to happen in silence.

Terrain shading

Set spec.basemap.overlays.hillshade to under to turn hillshade On, or hidden to turn it Off. The legacy over value also means On at the same fixed position. On streets, shading appears beneath water, roads, labels and data. On satellite it appears above imagery, beneath labels and data. When Off (the default), no shading source or elevation tile requests are added. The host must enable hillshade and supply elevation tiles.