---
title: "<ScriptLeafletGeoJson> · Nuxt Scripts"
description: "Adds inline GeoJSON through L.geoJSON. Replacing data clears and repopulates the existing layer; changing options.style updates its path style."
canonical_url: "https://scripts.nuxt.com/scripts/leaflet/api/geojson"
meta:
  "og:description": "Adds inline GeoJSON through L.geoJSON. Replacing data clears and repopulates the existing layer; changing options.style updates its path style."
  "og:image": "https://scripts.nuxt.com/_og/s/o_cd8a1e5724aef4c5.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "<ScriptLeafletGeoJson> · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/s/o_cd8a1e5724aef4c5.png"
---

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

**Api**

# **\<ScriptLeafletGeoJson>**

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

Adds inline GeoJSON through `**L.geoJSON**`. Replacing `**data**` clears and repopulates the existing layer; changing `**options.style**` updates its path style.

`**data**``GeoJsonObject | GeoJsonObject[]`** required **

`**options**``Leaflet.GeoJSONOptions`

Remote fetching is intentionally outside the component. Fetch and validate data with `**useFetch**`, then pass the resulting object to `**data**` so loading and failure states remain explicit.

[Edit this page](https://github.com/nuxt/scripts/edit/main/docs/content/leaflet/2.api/5.geojson.md)

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

[**\<ScriptLeafletPopup>** Renders slotted HTML in an L.Popup. Nest it inside a marker, or pass position for a standalone popup. Use the reactive open prop to control visibility.](https://scripts.nuxt.com/scripts/leaflet/api/popup) [**useScriptLeaflet** Use useScriptLeaflet() when you need direct access to the Leaflet namespace or are building your own map component.](https://scripts.nuxt.com/scripts/leaflet/api/use-script-leaflet)

```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/geojson#webpage","@type":"WebPage","description":"Adds inline GeoJSON through L.geoJSON. Replacing data clears and repopulates the existing layer; changing options.style updates its path style.","name":"<ScriptLeafletGeoJson>","url":"https://scripts.nuxt.com/scripts/leaflet/api/geojson","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/leaflet/api/geojson#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/leaflet/api/geojson"]}],"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/geojson#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":"<ScriptLeafletGeoJson>","item":"https://scripts.nuxt.com/scripts/leaflet/api/geojson","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.
