Map block (v2)
A format-v2 map block (version: 2): the same capabilities as v1, split into a style: half (everything that erases to a MapLibre style.json) and a runtime: half (everything that degrades). Source and layer spec bodies are the v1 ones; their live-data and experience keys move under a nested runtime:. For the why, see Format v2.
version
Section titled “version”Type: 2 · Required
Format version — v2 documents state version: 2
Type: "map" · Required
Block type
Type: string · Required
Unique block identifier
Type: object · Required
The style half — everything that erases to style.json
basemap
Section titled “basemap”Path: style.basemap · Type: string (URL) | any
Base style URL or inline style object (v2 rename of v1 mapStyle)
center
Section titled “center”Path: style.center · Type: [number, number]
Map center [longitude, latitude]
Path: style.zoom · Type: number · Range: 0 to 24
Zoom level (0-24)
Path: style.pitch · Type: number · Default: 0 · Range: 0 to 85
Camera pitch angle (0-85)
bearing
Section titled “bearing”Path: style.bearing · Type: number · Default: 0 · Range: -180 to 180
Camera bearing (-180-180)
metadata
Section titled “metadata”Path: style.metadata · Type: map of any
Style metadata (style-spec root metadata slot)
Path: style.state · Type: map of object
Spec-native runtime-tunable values, read via global-state
Same shape as state.
images
Section titled “images”Path: style.images · Type: map of string | object
Named images for symbol layers and patterns — style half, merged into the sprite on export
Same shape as images.
terrain
Section titled “terrain”Path: style.terrain · Type: object
3D terrain from a raster-dem source — style half, compiles to style.json terrain
Same shape as terrain.
Path: style.sky · Type: object
Sky, fog, and globe atmosphere — style half, compiles to style.json sky
Same shape as sky.
projection
Section titled “projection”Path: style.projection · Type: object
Map projection (globe needs maplibre-gl >= 5) — style half, compiles to style.json projection
Same shape as projection.
Path: style.light · Type: object
The style-spec light shading fill-extrusion faces — style half, compiles to style.json light
Same shape as light.
sources
Section titled “sources”Path: style.sources · Type: map of object
Map sources, each with an optional nested runtime:
<source-id>
Section titled “<source-id>”Path: style.sources.<source-id> · Type: object
One of 6 variants, selected by type: geojson, vector, raster, raster-dem, image, video.
type: geojson
Section titled “type: geojson”Path: style.sources.<source-id>.type · Type: "geojson" · Required
Source type
Path: style.sources.<source-id>.url · Type: string · Pattern: ^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/|\.\.?\/)
URL to fetch GeoJSON data
Path: style.sources.<source-id>.data · Type: GeoJSON
Inline GeoJSON object
cluster
Section titled “cluster”Path: style.sources.<source-id>.cluster · Type: boolean
Enable point clustering
clusterRadius
Section titled “clusterRadius”Path: style.sources.<source-id>.clusterRadius · Type: integer · Minimum: 0
Cluster radius in pixels (default: 50)
clusterMaxZoom
Section titled “clusterMaxZoom”Path: style.sources.<source-id>.clusterMaxZoom · Type: number · Range: 0 to 24
Maximum zoom level to cluster points
clusterMinPoints
Section titled “clusterMinPoints”Path: style.sources.<source-id>.clusterMinPoints · Type: integer · Minimum: 2
Minimum points to form a cluster
clusterProperties
Section titled “clusterProperties”Path: style.sources.<source-id>.clusterProperties · Type: map of any
Aggregate cluster properties
tolerance
Section titled “tolerance”Path: style.sources.<source-id>.tolerance · Type: number
Douglas-Peucker simplification tolerance (higher = simpler geometry)
buffer
Section titled “buffer”Path: style.sources.<source-id>.buffer · Type: number
Tile buffer size on each side, in pixels at tile scale
lineMetrics
Section titled “lineMetrics”Path: style.sources.<source-id>.lineMetrics · Type: boolean
Calculate line distance metrics (required for line-gradient)
generateId
Section titled “generateId”Path: style.sources.<source-id>.generateId · Type: boolean
Assign feature ids from each feature’s index (enables feature-state)
promoteId
Section titled “promoteId”Path: style.sources.<source-id>.promoteId · Type: string | map of string
Feature property to use as the feature id (for feature-state), or a map of source-layer name to property name
attribution
Section titled “attribution”Path: style.sources.<source-id>.attribution · Type: string
Attribution text
runtime
Section titled “runtime”Path: style.sources.<source-id>.runtime · Type: object · Default: {}
Per-source live-data configuration
refresh
Section titled “refresh”Path: style.sources.<source-id>.runtime.refresh · Type: object
Polling refresh configuration
Same shape as sources.<source-id>.refresh (type: geojson).
stream
Section titled “stream”Path: style.sources.<source-id>.runtime.stream · Type: object
WebSocket/SSE streaming configuration
Same shape as sources.<source-id>.stream (type: geojson).
Path: style.sources.<source-id>.runtime.cache · Type: object
Cache configuration
Same shape as sources.<source-id>.cache (type: geojson).
loading
Section titled “loading”Path: style.sources.<source-id>.runtime.loading · Type: object
Loading UI configuration
Same shape as sources.<source-id>.loading (type: geojson).
prefetchedData
Section titled “prefetchedData”Path: style.sources.<source-id>.runtime.prefetchedData · Type: GeoJSON
Pre-fetched inline GeoJSON from build time
fetchStrategy
Section titled “fetchStrategy”Path: style.sources.<source-id>.runtime.fetchStrategy · Type: "runtime" | "build" | "hybrid" · Default: "runtime"
When to fetch data: runtime (default), build, or hybrid
type: vector
Section titled “type: vector”Path: style.sources.<source-id>.type · Type: "vector" · Required
Source type
Path: style.sources.<source-id>.url · Type: string · Pattern: ^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/|\.\.?\/)
TileJSON URL
Path: style.sources.<source-id>.tiles · Type: string[]
Tile URL template array
minzoom
Section titled “minzoom”Path: style.sources.<source-id>.minzoom · Type: number · Range: 0 to 24
Minimum zoom level
maxzoom
Section titled “maxzoom”Path: style.sources.<source-id>.maxzoom · Type: number · Range: 0 to 24
Maximum zoom level
bounds
Section titled “bounds”Path: style.sources.<source-id>.bounds · Type: [number, number, number, number]
Bounding box [west, south, east, north]
scheme
Section titled “scheme”Path: style.sources.<source-id>.scheme · Type: "xyz" | "tms"
Tile coordinate scheme
attribution
Section titled “attribution”Path: style.sources.<source-id>.attribution · Type: string
Attribution text
promoteId
Section titled “promoteId”Path: style.sources.<source-id>.promoteId · Type: string | map of string
Feature property to use as the feature id (for feature-state), or a map of source-layer name to property name
volatile
Section titled “volatile”Path: style.sources.<source-id>.volatile · Type: boolean
Skip the tile cache (MapLibre volatile); for frequently changing tiles
runtime
Section titled “runtime”Path: style.sources.<source-id>.runtime · Type: object
Per-source live-data configuration
refresh
Section titled “refresh”Path: style.sources.<source-id>.runtime.refresh · Type: object
Polling refresh configuration
Same shape as sources.<source-id>.refresh (type: geojson).
stream
Section titled “stream”Path: style.sources.<source-id>.runtime.stream · Type: object
WebSocket/SSE streaming configuration
Same shape as sources.<source-id>.stream (type: geojson).
Path: style.sources.<source-id>.runtime.cache · Type: object
Cache configuration
Same shape as sources.<source-id>.cache (type: geojson).
loading
Section titled “loading”Path: style.sources.<source-id>.runtime.loading · Type: object
Loading UI configuration
Same shape as sources.<source-id>.loading (type: geojson).
prefetchedData
Section titled “prefetchedData”Path: style.sources.<source-id>.runtime.prefetchedData · Type: any
Pre-fetched data from build time
fetchStrategy
Section titled “fetchStrategy”Path: style.sources.<source-id>.runtime.fetchStrategy · Type: "runtime" | "build" | "hybrid"
When to fetch data: runtime (default), build, or hybrid
type: raster
Section titled “type: raster”Path: style.sources.<source-id>.type · Type: "raster" · Required
Source type
Path: style.sources.<source-id>.url · Type: string · Pattern: ^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/|\.\.?\/)
TileJSON URL
Path: style.sources.<source-id>.tiles · Type: string[]
Tile URL template array
tileSize
Section titled “tileSize”Path: style.sources.<source-id>.tileSize · Type: integer · Default: 512 · Minimum: 1
Tile size in pixels
minzoom
Section titled “minzoom”Path: style.sources.<source-id>.minzoom · Type: number · Range: 0 to 24
Minimum zoom level
maxzoom
Section titled “maxzoom”Path: style.sources.<source-id>.maxzoom · Type: number · Range: 0 to 24
Maximum zoom level
bounds
Section titled “bounds”Path: style.sources.<source-id>.bounds · Type: [number, number, number, number]
Bounding box [west, south, east, north]
scheme
Section titled “scheme”Path: style.sources.<source-id>.scheme · Type: "xyz" | "tms"
Tile coordinate scheme
attribution
Section titled “attribution”Path: style.sources.<source-id>.attribution · Type: string
Attribution text
volatile
Section titled “volatile”Path: style.sources.<source-id>.volatile · Type: boolean
Skip the tile cache (MapLibre volatile); for frequently changing tiles
runtime
Section titled “runtime”Path: style.sources.<source-id>.runtime · Type: object
Per-source live-data configuration
Same shape as style.sources.<source-id>.runtime (type: vector).
type: raster-dem
Section titled “type: raster-dem”Path: style.sources.<source-id>.type · Type: "raster-dem" · Required
Source type
Path: style.sources.<source-id>.url · Type: string · Pattern: ^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/|\.\.?\/)
TileJSON URL
Path: style.sources.<source-id>.tiles · Type: string[]
Tile URL template array
tileSize
Section titled “tileSize”Path: style.sources.<source-id>.tileSize · Type: integer · Default: 512 · Minimum: 1
Tile size in pixels
encoding
Section titled “encoding”Path: style.sources.<source-id>.encoding · Type: "terrarium" | "mapbox" | "custom" · Default: "mapbox"
How elevation is encoded in the tile’s RGB channels
minzoom
Section titled “minzoom”Path: style.sources.<source-id>.minzoom · Type: number · Range: 0 to 24
Minimum zoom level
maxzoom
Section titled “maxzoom”Path: style.sources.<source-id>.maxzoom · Type: number · Range: 0 to 24
Maximum zoom level
bounds
Section titled “bounds”Path: style.sources.<source-id>.bounds · Type: [number, number, number, number]
Bounding box [west, south, east, north]
attribution
Section titled “attribution”Path: style.sources.<source-id>.attribution · Type: string
Attribution text
volatile
Section titled “volatile”Path: style.sources.<source-id>.volatile · Type: boolean
Skip the tile cache (MapLibre volatile); for frequently changing tiles
runtime
Section titled “runtime”Path: style.sources.<source-id>.runtime · Type: object
Per-source live-data configuration
Same shape as style.sources.<source-id>.runtime (type: vector).
type: image
Section titled “type: image”Path: style.sources.<source-id>.type · Type: "image" · Required
Source type
Path: style.sources.<source-id>.url · Type: string · Required · Pattern: ^(?:[a-zA-Z][a-zA-Z\d+\-.]*:|\/|\.\.?\/)
Image URL
coordinates
Section titled “coordinates”Path: style.sources.<source-id>.coordinates · Type: [[number, number], [number, number], [number, number], [number, number]] · Required
Four corner coordinates [topLeft, topRight, bottomRight, bottomLeft]
runtime
Section titled “runtime”Path: style.sources.<source-id>.runtime · Type: object
Per-source live-data configuration
Same shape as style.sources.<source-id>.runtime (type: vector).
type: video
Section titled “type: video”Path: style.sources.<source-id>.type · Type: "video" · Required
Source type
Path: style.sources.<source-id>.urls · Type: string[] · Required · Min items: 1
Array of video URLs for browser compatibility
coordinates
Section titled “coordinates”Path: style.sources.<source-id>.coordinates · Type: [[number, number], [number, number], [number, number], [number, number]] · Required
Four corner coordinates [topLeft, topRight, bottomRight, bottomLeft]
runtime
Section titled “runtime”Path: style.sources.<source-id>.runtime · Type: object
Per-source live-data configuration
Same shape as style.sources.<source-id>.runtime (type: vector).
layers
Section titled “layers”Path: style.layers · Type: object[] · Default: []
Map layers, each with an optional nested runtime:
One of 10 variants, selected by type: circle, line, fill, symbol, raster, fill-extrusion, heatmap, hillshade, color-relief, background.
Common fields
Section titled “Common fields”Accepted by every variant that lists them below.
Path: style.layers[].id · Type: string · Required
Unique layer identifier
Path: style.layers[].label · Type: string
Human-readable layer label
source
Section titled “source”Path: style.layers[].source · Type: string | object
Layer source: a named-source string ref, or an inline v2 source (nested runtime:, strict RFC 7946 data)
Object form: same shape as style.sources.<source-id>.
source-layer
Section titled “source-layer”Path: style.layers[].source-layer · Type: string
Source layer name (for vector sources)
minzoom
Section titled “minzoom”Path: style.layers[].minzoom · Type: number · Range: 0 to 24
Minimum zoom level to show layer
maxzoom
Section titled “maxzoom”Path: style.layers[].maxzoom · Type: number · Range: 0 to 24
Maximum zoom level to show layer
filter
Section titled “filter”Path: style.layers[].filter · Type: array
MapLibre filter expression
visible
Section titled “visible”Path: style.layers[].visible · Type: boolean · Default: true
Initial visibility state
toggleable
Section titled “toggleable”Path: style.layers[].toggleable · Type: boolean · Default: true
Allow users to toggle visibility
before
Section titled “before”Path: style.layers[].before · Type: string
Layer ID to insert this layer before
interactive
Section titled “interactive”Path: style.layers[].interactive · Type: object
Interactive event configuration
Same shape as layers[].interactive.
legend
Section titled “legend”Path: style.layers[].legend · Type: object
Legend configuration
Same shape as layers[].legend.
effect
Section titled “effect”Path: style.layers[].effect · Type: object
Experimental: a registered shader effect (type + flat params) that enhances this layer; the layer itself is the static fallback
Same shape as layers[].effect.
metadata
Section titled “metadata”Path: style.layers[].metadata · Type: map of any
Custom metadata
runtime
Section titled “runtime”Path: style.layers[].runtime · Type: object
Per-layer experience configuration
interactive
Section titled “interactive”Path: style.layers[].runtime.interactive · Type: object
Interactive event configuration
Same shape as layers[].interactive.
legend
Section titled “legend”Path: style.layers[].runtime.legend · Type: object
Legend entry for this layer
Same shape as layers[].legend.
Path: style.layers[].runtime.label · Type: string
Human-readable layer label
toggleable
Section titled “toggleable”Path: style.layers[].runtime.toggleable · Type: boolean
Allow users to toggle visibility
effect
Section titled “effect”Path: style.layers[].runtime.effect · Type: object
Experimental: a registered shader effect (type + flat params) that enhances this layer; the layer itself is the static fallback
Same shape as layers[].effect.
extends
Section titled “extends”Path: style.layers[].extends · Type: any
Reserved — layer inheritance (v2). The key name is claimed; the semantics are not defined and the value is unread.
type: circle
Section titled “type: circle”Common fields: id, label, source, source-layer, minzoom, maxzoom, filter, visible, toggleable, before, interactive, legend, effect, metadata, runtime, extends.
Path: style.layers[].type · Type: "circle" · Required
Layer type
Path: style.layers[].paint · Type: object
Circle paint properties
Same shape as layers[].paint (type: circle).
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Circle layout properties
Any other MapLibre layout property valid for this layer type is accepted as well; the MapLibre style spec is the reference for each property’s semantics.
type: line
Section titled “type: line”Common fields: id, label, source, source-layer, minzoom, maxzoom, filter, visible, toggleable, before, interactive, legend, effect, metadata, runtime, extends.
Path: style.layers[].type · Type: "line" · Required
Layer type
Path: style.layers[].paint · Type: object
Line paint properties
Same shape as layers[].paint (type: line).
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Line layout properties
Same shape as layers[].layout (type: line).
type: fill
Section titled “type: fill”Common fields: id, label, source, source-layer, minzoom, maxzoom, filter, visible, toggleable, before, interactive, legend, effect, metadata, runtime, extends.
Path: style.layers[].type · Type: "fill" · Required
Layer type
Path: style.layers[].paint · Type: object
Fill paint properties
Same shape as layers[].paint (type: fill).
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Fill layout properties
Same shape as layers[].layout (type: fill).
type: symbol
Section titled “type: symbol”Common fields: id, label, source, source-layer, minzoom, maxzoom, filter, visible, toggleable, before, interactive, legend, effect, metadata, runtime, extends.
Path: style.layers[].type · Type: "symbol" · Required
Layer type
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Symbol layout properties
Same shape as layers[].layout (type: symbol).
Path: style.layers[].paint · Type: object
Symbol paint properties
Same shape as layers[].paint (type: symbol).
type: raster
Section titled “type: raster”Common fields: id, label, source, source-layer, minzoom, maxzoom, filter, visible, toggleable, before, interactive, legend, effect, metadata, runtime, extends.
Path: style.layers[].type · Type: "raster" · Required
Layer type
Path: style.layers[].paint · Type: object
Raster paint properties
Same shape as layers[].paint (type: raster).
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Raster layout properties
Any other MapLibre layout property valid for this layer type is accepted as well; the MapLibre style spec is the reference for each property’s semantics.
type: fill-extrusion
Section titled “type: fill-extrusion”Common fields: id, label, source, source-layer, minzoom, maxzoom, filter, visible, toggleable, before, interactive, legend, effect, metadata, runtime, extends.
Path: style.layers[].type · Type: "fill-extrusion" · Required
Layer type
Path: style.layers[].paint · Type: object
Fill extrusion paint properties
Same shape as layers[].paint (type: fill-extrusion).
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Fill extrusion layout properties
Any other MapLibre layout property valid for this layer type is accepted as well; the MapLibre style spec is the reference for each property’s semantics.
type: heatmap
Section titled “type: heatmap”Common fields: id, label, source, source-layer, minzoom, maxzoom, filter, visible, toggleable, before, interactive, legend, effect, metadata, runtime, extends.
Path: style.layers[].type · Type: "heatmap" · Required
Layer type
Path: style.layers[].paint · Type: object
Heatmap paint properties
Same shape as layers[].paint (type: heatmap).
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Heatmap layout properties
Any other MapLibre layout property valid for this layer type is accepted as well; the MapLibre style spec is the reference for each property’s semantics.
type: hillshade
Section titled “type: hillshade”Common fields: id, label, source, source-layer, minzoom, maxzoom, filter, visible, toggleable, before, interactive, legend, effect, metadata, runtime, extends.
Path: style.layers[].type · Type: "hillshade" · Required
Layer type
Path: style.layers[].paint · Type: object
Hillshade paint properties
Same shape as layers[].paint (type: hillshade).
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Hillshade layout properties
Any other MapLibre layout property valid for this layer type is accepted as well; the MapLibre style spec is the reference for each property’s semantics.
type: color-relief
Section titled “type: color-relief”Common fields: id, label, source, source-layer, minzoom, maxzoom, filter, visible, toggleable, before, interactive, legend, effect, metadata, runtime, extends.
Path: style.layers[].type · Type: "color-relief" · Required
Layer type (maplibre-gl >= 5.6)
Path: style.layers[].paint · Type: object
Color-relief paint properties
Same shape as layers[].paint (type: color-relief).
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Color-relief layout properties
Any other MapLibre layout property valid for this layer type is accepted as well; the MapLibre style spec is the reference for each property’s semantics.
type: background
Section titled “type: background”Common fields: runtime, extends, source.
Path: style.layers[].id · Type: string · Required
Unique layer identifier
Path: style.layers[].type · Type: "background" · Required
Layer type
Path: style.layers[].paint · Type: object
Background paint properties
Same shape as layers[].paint (type: background).
layout
Section titled “layout”Path: style.layers[].layout · Type: object
Background layout properties
Any other MapLibre layout property valid for this layer type is accepted as well; the MapLibre style spec is the reference for each property’s semantics.
metadata
Section titled “metadata”Path: style.layers[].metadata · Type: map of any
Custom metadata
runtime
Section titled “runtime”Type: object · Default: {}
The runtime half
Path: runtime.map · Type: object · Default: {}
MapLibre Map constructor options
interactive
Section titled “interactive”Path: runtime.map.interactive · Type: boolean · Default: true
Enable map interaction
controls
Section titled “controls”Path: runtime.controls · Type: object
Map controls
Same shape as controls.
legend
Section titled “legend”Path: runtime.legend · Type: object
Legend configuration
Same shape as legend.
parameters
Section titled “parameters”Path: runtime.parameters · Type: map of object
Presentation metadata for state keys — label, type, range
Same shape as parameters.
markers
Section titled “markers”Path: runtime.markers · Type: object[]
Standalone markers — DOM pins live, symbol layers + sprite on export
Same shape as markers.
Path: runtime.fitTo · Type: object
Fit the initial camera to a GeoJSON source’s data (v1: config.fitTo)
Same shape as config.fitTo.
popups
Section titled “popups”Path: runtime.popups · Type: object[]
Standalone popups open at a coordinate — no layer, no marker
Same shape as popups.
container
Section titled “container”Path: runtime.container · Type: object
Map container presentation (v2 home of v1’s style:/className:)
Path: runtime.container.style · Type: string
Inline CSS styles for the map container
className
Section titled “className”Path: runtime.container.className · Type: string
CSS class name for the map container
Type: map of object
Runtime-tunable values (may live here or under style:)
Same shape as state.
parameters
Section titled “parameters”Type: map of object
Presentation metadata for state keys (may live here or under runtime:)
Same shape as parameters.