Skip to main content

Interface: PolygonExtrusion

Defined in: spec/types.ts:369

3D extrusion of a polygon layer: each feature rises into a prism whose height follows the same mapData value its colour does, so darker classes stand taller. The geometry is the source's own 2D polygons — no height in the GeoJSON; MapLibre lifts them at render time (fill-extrusion).

In 'class' mode (default) every class of the active threshold legend gets its own height — evenly stepped up to maxHeight, or the explicit heights — so a prism's height and colour always tell the same class. In 'continuous' mode the height is proportional to the value: 0 stands flat, the dataset's largest value stands maxHeight tall. A 'class' layer whose active legend has no thresholds falls back to 'continuous'.

Features without a value stay flat (height 0). Heights are in metres. The effect reads best with a pitched camera (view.pitch).

The height can read a dataset of its own, so colour and height compare two indicators on the same features — darker and taller where both are high, darker but low where only the colour's is. Point mapDataId at a mapData entry on the layer's source, with a stateKey apart from the colour's (both land in the same features' state), and give it thresholds for 'class' mode: the colour legend's breaks belong to the other indicator.

Properties​

heights?​

optional heights?: number[]

Defined in: spec/types.ts:390

'class' mode only: explicit height of each class, lowest class first — one more entry than the legend has thresholds. Overrides maxHeight; a shorter list repeats its last height for the remaining classes.


mapDataId?​

optional mapDataId?: string

Defined in: spec/types.ts:376

The mapData entry the height reads. Omit it to read the colour's — the same indicator in both. Must sit on the layer's source.


maxHeight?​

optional maxHeight?: number

Defined in: spec/types.ts:384

Height, in metres, of the top class or the largest value. Default: 3000.


mode?​

optional mode?: "class" | "continuous"

Defined in: spec/types.ts:371

Height mapping. Default: 'class'.


thresholds?​

optional thresholds?: number[]

Defined in: spec/types.ts:382

'class' mode breaks for the height, ascending. Default: the active legend's when the height reads the colour's dataset; none otherwise — a dataset of its own without them is read 'continuous'.


transitionMs?​

optional transitionMs?: number

Defined in: spec/types.ts:397

Duration, in milliseconds, of the prisms' rise and fall: when the layer gains or loses extrusion, and whenever its heights change (a new maxHeight, new data). 0 snaps. Default: 600. A viewer's reduced-motion setting snaps too.