Svelte Maplibre

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

Source: src/lib/RasterDEMTileSource.svelte