API / Map
ZoomRange
Set minzoom and maxzoom for all components inside the slot. By default this only propagates the value to the inner layers.
You can set enforce to true to tear down the slot contents when the zoom is outside the range. This is usually bad for performance, so it is not recommended for use with map layers, but can have other uses such as creating and removing map controls or other behaviors depending on zoom level.
import { ZoomRange } from 'svelte-maplibre'; Examples
Props
Source: src/lib/ZoomRange.svelte