ColorReliefLayerSchema
constColorReliefLayerSchema:ZodObject<object&object,"passthrough",ZodTypeAny,objectOutputType<object&object,ZodTypeAny,"passthrough">,objectInputType<object&object,ZodTypeAny,"passthrough">>
Defined in: packages/core/src/schemas/layer.schema.ts:1125
Color-relief layer: hypsometric tinting of a raster DEM (maplibre-gl ≥ 5.6).
Remarks
Section titled “Remarks”Colors each DEM pixel by its elevation. color-relief-color is a color
ramp over the ["elevation"] expression, exactly like heatmap-color is
a ramp over ["heatmap-density"]. The source must be raster-dem — the
same sources hillshade layers draw from.
Runtime floor: the layer type exists from maplibre-gl 5.6.0. On an
older runtime the renderer skips the layer with one warning (a declared
absence) instead of letting MapLibre reject the document; emit with a
--target below 5.6 reports the layer as lossy.
Example
Section titled “Example”- id: relief type: color-relief source: type: raster-dem url: "https://demotiles.maplibre.org/terrain-tiles/tiles.json" tileSize: 256 paint: color-relief-color: - interpolate - ["linear"] - ["elevation"] - 400 - "rgb(4, 0, 108)" - 3500 - "rgb(215, 5, 13)"