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. Framework integrations render it; it is never the src of <ml-map>. For narrative see Root Configuration and Pages & Blocks.

Type: object

Global configuration

Path: config.title · Type: string

Application title

Path: config.description · Type: string

Application description

Path: config.defaultMapStyle · Type: string (URL)

Default map style URL

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

Default theme

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

Data fetching configuration

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

Default fetch strategy

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

Default timeout in milliseconds

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

Default retry attempts

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

Page definitions

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 for rich text and media

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) reference.

Full-page map block

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[].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

Same shape as legend.

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 for combining multiple block types

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[].