---
title: "Tiles & Attribution · Nuxt Scripts"
description: "Leaflet renders and controls the map, but it does not supply map imagery. Add a ScriptLeafletTileLayer for each raster tile service you use."
canonical_url: "https://scripts.nuxt.com/scripts/leaflet/guides/tiles-and-attribution"
meta:
  "og:description": "Leaflet renders and controls the map, but it does not supply map imagery. Add a ScriptLeafletTileLayer for each raster tile service you use."
  "og:image": "https://scripts.nuxt.com/_og/s/o_bb783be3ff5f2c2c.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Tiles & Attribution · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/s/o_bb783be3ff5f2c2c.png"
---

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

**Guides**

# **Tiles & Attribution**

[Copy for LLMs](https://scripts.nuxt.com/scripts/leaflet/guides/tiles-and-attribution.md)

Leaflet renders and controls the map, but it does not supply map imagery. Add a `**ScriptLeafletTileLayer**` for each raster tile service you use.

## Choose a Tile Service

A tile URL usually contains `**{z}**`, `**{x}**`, and `**{y}**` placeholders:

```vue
<ScriptLeafletTileLayer
  url="https://tile.openstreetmap.org/{z}/{x}/{y}.png"
  :options="{
    maxZoom: 19,
    attribution: '&copy; <a href=&quot;https://www.openstreetmap.org/copyright&quot;>OpenStreetMap contributors</a>',
  }"
/>
```

For production, check the service's traffic limits, caching rules, allowed use cases, privacy policy, and availability commitments. Some providers require an API key or account. Others offer downloadable tiles for self-hosting.

Keep the URL configurable so you can change providers without rewriting the map component:

nuxt.config.ts

```ts
export default defineNuxtConfig({
  runtimeConfig: {
    public: {
      mapTileUrl: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
    },
  },
})
```

```vue
<script setup lang="ts">
const config = useRuntimeConfig()
const tileAttribution = '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap contributors</a>'
</script>

<template>
  <ScriptLeafletTileLayer
    :url="config.public.mapTileUrl"
    :options="{ attribution: tileAttribution }"
  />
</template>
```

## OpenStreetMap's Standard Tiles

OpenStreetMap data is open, but the standard tile servers are a donation-funded public service. They have no SLA and may block clients that break the [**tile usage policy**](https://operations.osmfoundation.org/policies/tiles/).

When using `**tile.openstreetmap.org**`:

- Keep `**© OpenStreetMap contributors**` visible on the map.
- Use the official HTTPS tile URL and allow the browser to send its normal referrer.
- Respect HTTP caching headers. Do not force tiles to bypass the browser cache.
- Do not bulk download, prefetch areas, or add offline download features.

Normal browser-based map viewing follows the technical caching and identification requirements. A proxy, native client, or offline feature needs additional work and may need a different provider.

## Attribution

Pass the provider's required attribution through the tile layer `**options**`. Leaflet combines attribution from active layers in its attribution control.

Do not cover the control with page UI or remove it. If your map uses several data or imagery sources, include the attribution required by each source.

## Failure Fallback

Tile services can reject requests or become unavailable while the rest of the page still works. Keep essential locations in HTML and provide a useful error state:

```vue
<ScriptLeafletMap :center="[-37.8136, 144.9631]" :zoom="13">
  <template #error>
    <p role="alert">
      The map is unavailable. Use the location list to choose a store.
    </p>
  </template>
</ScriptLeafletMap>
```

[Edit this page](https://github.com/nuxt/scripts/edit/main/docs/content/leaflet/1.guides/2.tiles-and-attribution.md)

[Markdown For LLMs](https://scripts.nuxt.com/scripts/leaflet/guides/tiles-and-attribution.md)

[**Example: Pickup Locator** Build a production-shaped store locator with accessible selection, map fallbacks, popups, and a delivery zone.](https://scripts.nuxt.com/scripts/leaflet/guides/pickup-locator) [**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)

**On this page **

- [Choose a Tile Service](#choose-a-tile-service)
- [OpenStreetMap's Standard Tiles](#openstreetmaps-standard-tiles)
- [Attribution](#attribution)
- [Failure Fallback](#failure-fallback)

```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/guides/tiles-and-attribution#webpage","@type":"WebPage","description":"Leaflet renders and controls the map, but it does not supply map imagery. Add a ScriptLeafletTileLayer for each raster tile service you use.","name":"Tiles & Attribution","url":"https://scripts.nuxt.com/scripts/leaflet/guides/tiles-and-attribution","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/leaflet/guides/tiles-and-attribution#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/leaflet/guides/tiles-and-attribution"]}],"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/guides/tiles-and-attribution#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":"Guides","item":"https://scripts.nuxt.com/scripts/leaflet/guides","position":4},{"@type":"ListItem","name":"Tiles & Attribution","item":"https://scripts.nuxt.com/scripts/leaflet/guides/tiles-and-attribution","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.
