Skip to content

Root document (pages)

A root document: global config, shared named layers and sources, and a pages: list whose blocks are content, map, scrollytelling, or mixed blocks. No maplibre-yaml package renders it, and it is never the src of <ml-map>: write map documents and story maps instead.

Type: object

Global configuration

Path: config.title · Type: string

Application title

Path: config.description · Type: string

Application description

Path: config.defaultMapStyle · Type: string (URL) | object | any

Default map style: a style URL, a style object, or a Protomaps basemap ({ pmtiles, flavor, lang })

Same shape as config.mapStyle.

Path: config.theme · Type: "light" | "dark" · Default: "light"

No effect (deprecated): nothing reads it. A story’s own theme: is read

Path: config.defaultZoom · Type: number · Range: 0 to 24

Default zoom level for all maps

Path: config.defaultCenter · Type: [number, number]

Default center [lng, lat] for all maps

Path: config.dataFetching · Type: object

No effect (deprecated): nothing reads it

Path: config.dataFetching.defaultStrategy · Type: "runtime" | "build" | "hybrid" · Default: "runtime"

No effect (deprecated)

Path: config.dataFetching.timeout · Type: number · Default: 30000 · Minimum: 1000

No effect (deprecated)

Path: config.dataFetching.retryAttempts · Type: integer · Default: 3 · Minimum: 0

No effect (deprecated)

Type: map of object

Named layer definitions for reuse

Path: layers.<layer-id> · Type: object

Same shape as layers[].

Type: map of object

Named source definitions for reuse

Path: sources.<source-id> · Type: object

See the Sources reference.

Type: object[] · Required · Min items: 1

No effect (deprecated): multi-page documents validate, but no maplibre-yaml package renders them yet

Path: pages[].path · Type: string · Required

URL path (e.g., ”/”, “/about”)

Path: pages[].title · Type: string · Required

Page title

Path: pages[].description · Type: string

Page description for SEO

Path: pages[].blocks · Type: object[] · Required

Page content blocks

One of 5 variants, selected by type: content, map, map-fullpage, scrollytelling, mixed.

Content block (multi-page documents only). No effect (deprecated): no maplibre-yaml package renders it yet

Path: pages[].blocks[].type · Type: "content" · Required

Block type

Path: pages[].blocks[].id · Type: string

Unique block identifier

Path: pages[].blocks[].className · Type: string

CSS class name for the block container

Path: pages[].blocks[].style · Type: string

Inline CSS styles for the block container

Path: pages[].blocks[].content · Type: (map of object[])[] · Required

Array of content items to render

Path: pages[].blocks[].content[].<tag> · Type: object[]

Path: pages[].blocks[].content[].<tag>[].str · Type: string

Static text string

Path: pages[].blocks[].content[].<tag>[].property · Type: string

Dynamic property from context

Path: pages[].blocks[].content[].<tag>[].else · Type: string

Fallback value if property missing

Path: pages[].blocks[].content[].<tag>[].classList · Type: string | string[]

CSS class names (space-separated string or array)

Path: pages[].blocks[].content[].<tag>[].id · Type: string

Element ID attribute

Path: pages[].blocks[].content[].<tag>[].style · Type: string

Inline CSS styles

Path: pages[].blocks[].content[].<tag>[].href · Type: string (URL)

Link URL

Path: pages[].blocks[].content[].<tag>[].target · Type: string

Link target (_blank, _self, _parent, _top)

Path: pages[].blocks[].content[].<tag>[].src · Type: string (URL)

Source URL for img or iframe

Path: pages[].blocks[].content[].<tag>[].alt · Type: string

Alternative text for images

Path: pages[].blocks[].content[].<tag>[].width · Type: string | number

Width (pixels or %)

Path: pages[].blocks[].content[].<tag>[].height · Type: string | number

Height (pixels or %)

Standard map block

See the Map block (v1, default) reference.

Full-page map block (multi-page documents only). No effect (deprecated): no maplibre-yaml package renders it yet

Path: pages[].blocks[].type · Type: "map-fullpage" · Required

Block type

Path: pages[].blocks[].id · Type: string · Required

Unique block identifier

Path: pages[].blocks[].className · Type: string

CSS class name for container

Path: pages[].blocks[].style · Type: string

Inline CSS styles for container

Path: pages[].blocks[].title · Type: string

The map’s name, read out by screen readers as its accessible name (default: “Map”, or locale Map.Title)

Path: pages[].blocks[].description · Type: string

What the map shows, in a sentence or two — its text alternative, read by screen readers as the map’s description

Path: pages[].blocks[].config · Type: object · Required

Map configuration with MapLibre options

Same shape as config.

Path: pages[].blocks[].sources · Type: map of object

Map sources

Path: pages[].blocks[].sources.<source-id> · Type: object

See the Sources reference.

Path: pages[].blocks[].layers · Type: object[] · Default: []

Map layers

Each entry: see the Layers reference.

Path: pages[].blocks[].controls · Type: object

Map controls

Same shape as controls.

Path: pages[].blocks[].legend · Type: object

Legend configuration

Path: pages[].blocks[].legend.position · Type: "top-left" | "top-right" | "bottom-left" | "bottom-right" · Default: "top-left"

Legend position

Path: pages[].blocks[].legend.title · Type: string

Legend title

Path: pages[].blocks[].legend.collapsed · Type: boolean · Default: false

Start collapsed

Path: pages[].blocks[].legend.items · Type: object[]

Custom legend items (overrides layer legends)

Path: pages[].blocks[].legend.items[].color · Type: string · Required

Item color

Path: pages[].blocks[].legend.items[].label · Type: string · Required

Item label

Path: pages[].blocks[].legend.items[].shape · Type: "circle" | "square" | "line" | "icon" · Default: "square"

Symbol shape

Path: pages[].blocks[].legend.items[].icon · Type: string

Icon name/URL (for shape: icon)

Path: pages[].blocks[].state · Type: map of object

Runtime-tunable values, readable from expressions via global-state

Same shape as state.

Path: pages[].blocks[].parameters · Type: map of object

Presentation metadata for state keys — label, type, range

Same shape as parameters.

Path: pages[].blocks[].markers · Type: object[]

Standalone markers — DOM pins live, symbol layers + sprite on export

Same shape as markers.

Path: pages[].blocks[].popups · Type: object[]

Standalone popups open at a coordinate — no layer, no marker

Same shape as popups.

Path: pages[].blocks[].images · Type: map of string | object

Named images for symbol layers and patterns — loaded live, merged into the sprite on export

Same shape as images.

Path: pages[].blocks[].terrain · Type: object

3D terrain from a raster-dem source — setTerrain live, style.json terrain on export

Same shape as terrain.

Path: pages[].blocks[].sky · Type: object

Sky, fog, and globe atmosphere — setSky live (maplibre-gl >= 4.5), style.json sky on export

Same shape as sky.

Path: pages[].blocks[].projection · Type: object

Map projection (globe needs maplibre-gl >= 5) — style.json projection on export

Same shape as projection.

Path: pages[].blocks[].light · Type: object

The style-spec light shading fill-extrusion faces — map.setLight live, style.json light on export

Same shape as light.

Scrollytelling block for narrative map stories

See the Scrollytelling block reference.

Mixed block (multi-page documents only). No effect (deprecated): no maplibre-yaml package renders it yet

Path: pages[].blocks[].type · Type: "mixed" · Required

Block type

Path: pages[].blocks[].id · Type: string

Unique block identifier

Path: pages[].blocks[].className · Type: string

CSS class name for container

Path: pages[].blocks[].style · Type: string

Inline CSS styles for container

Path: pages[].blocks[].layout · Type: "row" | "column" | "grid" · Default: "row"

Layout direction

Path: pages[].blocks[].gap · Type: string

Gap between blocks (CSS gap property)

Path: pages[].blocks[].blocks · Type: object[] · Required

Child blocks

Each entry has the same shape as pages[].blocks[].