---
title: "useScriptLeaflet"
description: "Use useScriptLeaflet() when you need direct access to the Leaflet namespace or are building your own map component."
canonical_url: "https://scripts.nuxt.com/scripts/leaflet/api/use-script-leaflet"
last_updated: "2026-08-11T04:27:01.084Z"
---

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

<script-types filter="useScriptLeaflet" script-key="leaflet">



</script-types>

```ts
const { onLoaded } = useScriptLeaflet()

onLoaded(({ L }) => {
  const bounds = L.latLngBounds(points)
  // Use the Leaflet API directly.
})
```
