Skip to main content
Api

useScriptLeaflet

Use useScriptLeaflet() when you need direct access to the Leaflet namespace or are building your own map component.

const { onLoaded } = useScriptLeaflet()

onLoaded(({ L }) => {
  const bounds = L.latLngBounds(points)
  // Use the Leaflet API directly.
})
Was this page helpful?