Component
MapSource
GeoJSON (or any MapLibre source) for the layers inside it, with optional clustering.
import { MapSource } from '@loidolt/theme-maps';
Example
Focus the map to move it: arrow keys pan, plus and minus zoom, Shift with the arrows rotates and tilts.
Notes
- Replace the
dataobject to update the map in place; the layers drawing it are untouched. - Layers inside a
MapSourcepick up its id. Clusters come withclusterColor(),clusterRadius()andexpandCluster()from/core.
Props
Generated from the component source, so it cannot drift from the implementation.
| Prop | Type | Default | Notes |
|---|---|---|---|
id required | string | — | Unique on the map; layers name it as their source. |
attribution | string | — | Credit shown in the attribution control. |
children | Snippet | — | Layers drawn from this source. They pick up its id without naming it. |
cluster | boolean | ClusterOptions | false | Gather nearby points into clusters. |
data | GeoJSON | string | — | GeoJSON, or a URL to fetch it from. Replace the object to update the map. |
promoteId | string | — | A feature property to use as its id, for hover state and LayerManager. |
spec | Record<string, unknown> | — | Any other MapLibre source — vector or raster tiles, an image — as its specification. |