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

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

<script-types filter="useScriptMapLibre" script-key="maplibre">



</script-types>

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

onLoaded(({ maplibregl }) => {
  const bounds = new maplibregl.LngLatBounds(points)
  // Use the MapLibre API directly.
})
```
