Api
useScriptMapLibre
Use useScriptMapLibre() when you need direct access to the MapLibre namespace or are building your own map component.
const { onLoaded } = useScriptMapLibre()
onLoaded(({ maplibregl }) => {
const bounds = new maplibregl.LngLatBounds(points)
// Use the MapLibre API directly.
})<ScriptMapLibreGeoJson>
Adds a GeoJSON source and one or more MapLibre style layers. Replacing data updates the existing source. A paint, layout or filter change updates the layers in place. A change to cluster, clusterRadius or clusterMaxZoom updates the source in place. Any other layer or source option change rebuilds the source and layers in a controlled order.
<ScriptMapLibreScaleControl>
Adds MapLibre's scale bar to the nearest parent map. MapLibre places it in the bottom-left corner by default.