API / Sources
RasterDEMTileSource
Add a raster DEM (elevation) tile source to the map. Use it with Terrain or with a HillshadeLayer.
Place layer components inside this component's children and they use this source automatically. The children render only after the source is added. encoding and the factor props tell MapLibre how to decode the elevation from the tile colors.
When tiles changes, the component updates the tiles of the existing source. The other props are applied only when the source is created.
import { RasterDEMTileSource } from 'svelte-maplibre'; Examples
Props
- id
stringDefault:
getId('raster-source') - tileSize
number - bounds
[number, number, number, number] - attribution
string - minzoom
number - maxzoom
number - volatile
boolean - encoding
RasterDEMSourceSpecification['encoding'] - redFactor
number - greenFactor
number - blueFactor
number - baseShift
number - children
Snippet