Skip to content

Scrollytelling block

A type: scrollytelling block: one map plus an ordered list of chapters that drive the camera and layer visibility as the reader scrolls. For narrative and examples see Writing a story file.

Type: "scrollytelling" · Required

Block type

Type: string · Required

Unique block identifier

Type: string

CSS class name for container

Type: string

Inline CSS styles for container

Type: object · Required

Map configuration with MapLibre options

Same shape as config.

Type: "light" | "dark" · Default: "light"

Visual theme

Type: boolean · Default: false

Show the chapter rail: a column of dots beside the story, one per chapter, that jump to it (not markers on the map)

Type: string

Fill color of the chapter rail’s dots. Default: white dots with a dark outline, the current one larger and filled dark, which stand out on any basemap

Type: boolean · Default: true

Offset the camera so each chapter’s center is not under its card (false: centre it in the whole map)

Type: object[] · Default: []

Persistent layers (visible throughout story)

Each entry: see the Layers reference.

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

Story chapters

Path: chapters[].id · Type: string · Required

Unique chapter identifier

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

Chapter title

Path: chapters[].center · Type: [number, number] · Required

Map center [longitude, latitude]

Path: chapters[].zoom · Type: number · Required

Zoom level

Path: chapters[].description · Type: string

Chapter text as HTML (markdown is not converted)

Path: chapters[].image · Type: string · Pattern: ^(?:[hH][tT][tT][pP][sS]?:\/\/|\/|\.\.?\/|[^\s:/?#][^:/?#]*(?:[/?#]|$))

Hero image: an http(s) URL or a site path such as /images/photo.jpg

Path: chapters[].video · Type: string · Pattern: ^(?:[hH][tT][tT][pP][sS]?:\/\/|\/|\.\.?\/|[^\s:/?#][^:/?#]*(?:[/?#]|$))

Video: an http(s) URL or a site path such as /videos/clip.mp4

Path: chapters[].pitch · Type: number · Default: 0 · Range: 0 to 85

Camera pitch angle (0-85)

Path: chapters[].bearing · Type: number · Default: 0 · Range: -180 to 180

Camera bearing (-180 to 180)

Path: chapters[].speed · Type: number · Default: 0.6 · Range: 0 to 2

Animation speed multiplier (0-2)

Path: chapters[].curve · Type: number · Default: 1 · Range: 0 to 2

Animation curve (0=linear, 1=default, 2=steep)

Path: chapters[].animation · Type: "flyTo" | "easeTo" | "jumpTo" · Default: "flyTo"

Animation type

Path: chapters[].rotateAnimation · Type: boolean

Enable continuous rotation animation

Path: chapters[].spinGlobe · Type: boolean

Slowly pan the camera westward while this chapter is active (paused under prefers-reduced-motion). Globe projection itself is the map-level projection:

Path: chapters[].alignment · Type: "left" | "right" | "center" | "full" · Default: "center"

Content alignment

Path: chapters[].hidden · Type: boolean · Default: false

Hide chapter content (map-only)

Path: chapters[].padding · Type: number | object

Camera padding in pixels for this chapter, used as written instead of the automatic offset that keeps center clear of the card

Path: chapters[].padding.top · Type: number · Default: 0 · Minimum: 0

Pixels kept clear at the top

Path: chapters[].padding.right · Type: number · Default: 0 · Minimum: 0

Pixels kept clear on the right

Path: chapters[].padding.bottom · Type: number · Default: 0 · Minimum: 0

Pixels kept clear at the bottom

Path: chapters[].padding.left · Type: number · Default: 0 · Minimum: 0

Pixels kept clear on the left

Path: chapters[].layers · Type: object

Layer visibility control

Path: chapters[].layers.show · Type: string[] · Default: []

Layer IDs to show

Path: chapters[].layers.hide · Type: string[] · Default: []

Layer IDs to hide

Path: chapters[].onChapterEnter · Type: object[] · Default: []

Actions when entering chapter

Path: chapters[].onChapterEnter[].action · Type: string · Required

Action type

Allowed values: setFilter, setPaintProperty, setLayoutProperty, flyTo, easeTo, fitBounds, custom

Path: chapters[].onChapterEnter[].layer · Type: string

Target layer ID

Path: chapters[].onChapterEnter[].property · Type: string

Property name (for setPaintProperty/setLayoutProperty)

Path: chapters[].onChapterEnter[].value · Type: any

Property value

Path: chapters[].onChapterEnter[].filter · Type: array | null

Filter expression (for setFilter, null to clear)

Path: chapters[].onChapterEnter[].bounds · Type: [number, number, number, number] | [[number, number], [number, number]] | number[]

Bounds for fitBounds: [west, south, east, north] or [[west, south], [east, north]]

Path: chapters[].onChapterEnter[].options · Type: map of any

Additional options

Path: chapters[].onChapterExit · Type: object[] · Default: []

Actions when exiting chapter

Each entry has the same shape as chapters[].onChapterEnter[].

Path: chapters[].callback · Type: string

Custom callback function name

Type: string

Footer content (HTML)

Type: string

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

Type: string

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

Type: map of object

Map sources

Same shape as sources.

Type: object

Map controls

Same shape as controls.

Type: object | false

The story’s legend: pinned in one corner, above the chapter cards. A story with a classify: layer gets one automatically; false turns it off

Path: legend.position · Type: "top-left" | "top-right" | "bottom-left" | "bottom-right"

Legend corner. Default: top-left, or top-right on a wide screen whose cards are all on the left

Path: legend.title · Type: string

Legend title

Path: legend.collapsed · Type: boolean | "auto" · Default: "auto"

Start collapsed to a Legend button (true), open (false), or auto: collapsed on phones and where cards pass the legend’s corner, open elsewhere

Path: legend.items · Type: object[]

Custom legend items (overrides layer legends)

Same shape as legend.items.

Type: map of object

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

Same shape as state.

Type: map of object

Presentation metadata for state keys — label, type, range

Same shape as parameters.

Type: object[]

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

Same shape as markers.

Type: object[]

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

Same shape as popups.

Type: map of string | object

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

Same shape as images.

Type: object

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

Same shape as terrain.

Type: object

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

Same shape as sky.

Type: object

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

Same shape as projection.

Type: object

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

Same shape as light.