---
title: "<ScriptLeafletMap> · Nuxt Scripts"
description: "The map facade reserves layout space during SSR, loads Leaflet when triggered, creates the L.Map, and provides it to child components."
canonical_url: "https://scripts.nuxt.com/scripts/leaflet/api/script-leaflet-map"
meta:
  "og:description": "The map facade reserves layout space during SSR, loads Leaflet when triggered, creates the L.Map, and provides it to child components."
  "og:image": "https://scripts.nuxt.com/_og/s/o_216d1ada8e6761e6.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "<ScriptLeafletMap> · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/s/o_216d1ada8e6761e6.png"
---

> Index of every page on this site: [llms.txt](https://scripts.nuxt.com/llms.txt)

**Api**

# **\<ScriptLeafletMap>**

[Copy for LLMs](https://scripts.nuxt.com/scripts/leaflet/api/script-leaflet-map.md)

The map facade reserves layout space during SSR, loads Leaflet when triggered, creates the `**L.Map**`, and provides it to child components.

`**trigger**``ElementScriptTrigger` = 'visible'

Defines when the Leaflet script loads.

`**center**``Leaflet.LatLngExpression`** required **

`**zoom**``number`

`**options**``Leaflet.MapOptions`

`**injectStyles**``boolean`

`**width**``number | string`

`**height**``number | string`

`**ariaLabel**``string`

`**interactive**``boolean`

`**rootAttrs**``HTMLAttributes & ReservedProps & Record<string, unknown>`

`**center**` and `**zoom**` are reactive. Use `**v-model:center**` or `**v-model:zoom**` when you also want to receive user pan and zoom changes.

```vue
<ScriptLeafletMap
  v-model:center="center"
  v-model:zoom="zoom"
  width="100%"
  height="28rem"
  @ready="({ map }) => console.log(map.value)"
/>
```

The `**placeholder**`, `**awaitingLoad**`, `**loading**`, and `**error**` slots customize each loading state. The default error state is visible and announced with `**role="alert"**`.

[Edit this page](https://github.com/nuxt/scripts/edit/main/docs/content/leaflet/2.api/1.script-leaflet-map.md)

[Markdown For LLMs](https://scripts.nuxt.com/scripts/leaflet/api/script-leaflet-map.md)

[**Performance & Accessibility** ScriptLeafletMap loads near the viewport by default. It also reserves the configured dimensions during SSR, which prevents the page from shifting when Leaflet starts.](https://scripts.nuxt.com/scripts/leaflet/guides/performance-and-accessibility) [**\<ScriptLeafletTileLayer>** Adds an L.TileLayer to the nearest parent map. Nuxt Scripts does not choose a tile provider for you.](https://scripts.nuxt.com/scripts/leaflet/api/tile-layer)

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://scripts.nuxt.com/#website","@type":"WebSite","description":"Nuxt Scripts lets you load third-party scripts with better performance, privacy, security and DX. It includes many popular third-parties out of the box.","name":"Nuxt Scripts","url":"https://scripts.nuxt.com/","publisher":{"@id":"https://scripts.nuxt.com/#identity"}},{"@id":"https://scripts.nuxt.com/scripts/leaflet/api/script-leaflet-map#webpage","@type":"WebPage","description":"The map facade reserves layout space during SSR, loads Leaflet when triggered, creates the L.Map, and provides it to child components.","name":"<ScriptLeafletMap>","url":"https://scripts.nuxt.com/scripts/leaflet/api/script-leaflet-map","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/leaflet/api/script-leaflet-map#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/leaflet/api/script-leaflet-map"]}],"primaryImageOfPage":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/#identity","@type":"Organization","name":"Nuxt Scripts","url":"https://scripts.nuxt.com","logo":{"@id":"https://scripts.nuxt.com/#logo"}},{"@id":"https://scripts.nuxt.com/scripts/leaflet/api/script-leaflet-map#breadcrumb","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","name":"Nuxt Scripts","item":"https://scripts.nuxt.com/","position":1},{"@type":"ListItem","name":"Scripts","item":"https://scripts.nuxt.com/scripts","position":2},{"@type":"ListItem","name":"Leaflet","item":"https://scripts.nuxt.com/scripts/leaflet","position":3},{"@type":"ListItem","name":"API","item":"https://scripts.nuxt.com/scripts/leaflet/api","position":4},{"@type":"ListItem","name":"<ScriptLeafletMap>","item":"https://scripts.nuxt.com/scripts/leaflet/api/script-leaflet-map","position":5}]},{"@id":"https://scripts.nuxt.com/#logo","@type":"ImageObject","caption":"Nuxt Scripts","contentUrl":"https://scripts.nuxt.com/logo.svg","inLanguage":"en","url":"https://scripts.nuxt.com/logo.svg"}]}
```

## Sitemap

See the full [sitemap](https://scripts.nuxt.com/sitemap.md) for all pages.
