API / Controls
NavigationControl
Add the MapLibre navigation control to the map. This control shows zoom buttons and a compass.
Put it inside the MapLibre component. The component uses the props only when it creates the control. Changes to the props after that have no effect. The component removes the control when it is destroyed.
import { NavigationControl } from 'svelte-maplibre'; Examples
Props
- position
maplibregl.ControlPositionDefault:
'top-left' - showCompass
booleanDefault:
true - showZoom
booleanDefault:
true - visualizePitch
booleanDefault:
false
Source: src/lib/NavigationControl.svelte