Skip to content

TerrainMaterial

TerrainMaterial holds the render options for a terrain layer’s mesh. It is set via the terrain key and applies regardless of the source’s data format — raster-dem (RGB-encoded elevation) or quantized-mesh. All fetch/geometry config (zoom range, tiling scheme, elevation decoder, extensions, token) lives on the referenced source, not here.

Type: boolean | undefinedDefault: true

Description: Whether to show the terrain.

{ terrain: { show: true } }

Type: boolean | undefinedDefault: false

Description: Whether the terrain casts shadows.

{ terrain: { castShadow: true } }

Type: boolean | undefinedDefault: false

Description: Whether the terrain receives shadows.

{ terrain: { receiveShadow: true } }

Type: boolean | undefinedDefault: false

Description: Whether to show per-tile bounding boxes. Used for debugging.

{ terrain: { showBoundingBox: true } }

Type: boolean | undefinedDefault: true

Description: Whether to render skirts along tile boundaries to hide gaps between neighboring tiles at different LODs. Disable this if you want to visualize underground models.

{ terrain: { skirt: true } }

Type: number | undefinedDefault: 1.0

Description: Multiplier applied to the auto-calculated skirt height. 1.0 uses the default calculated height.

{ terrain: { skirtExaggeration: 1.5 } }

A terrain layer provides only the 3D surface. Drape imagery or shaded relief on top with a raster layer:

Over terrainSupportedNotes
raster (imagery)✅ YesRaster imagery is reprojected and draped onto the mesh. Multiple can be stacked.
raster (hillshade)✅ YesShaded relief computed from DEM tiles, rendered over the 3D surface.
vector (vector tiles)❌ Not yetVector tiles cannot currently be draped onto quantized-mesh terrain.