Svelte Maplibre

API / Controls

TerrainControl

Add the MapLibre terrain control to the map. This control shows a button that turns 3D terrain on and off.

Put it inside the MapLibre component. Set source to the ID of a raster DEM source, and exaggeration to the terrain height multiplier. The component uses the props only when it creates the control.

import { TerrainControl } from 'svelte-maplibre';

Examples

Props

Source: src/lib/TerrainControl.svelte