---
title: "Google Maps · Nuxt Scripts"
description: "Load interactive maps, static maps, and location search on demand."
canonical_url: "https://scripts.nuxt.com/scripts/google-maps"
meta:
  "og:description": "Load interactive maps, static maps, and location search on demand."
  "og:image": "https://scripts.nuxt.com/_og/s/o_cbb68a8cb119e41e.png"
  "og:image:height": "600"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "Google Maps · Nuxt Scripts"
  "twitter:image": "https://scripts.nuxt.com/_og/s/o_cbb68a8cb119e41e.png"
---

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

**Scripts**

# **Google Maps**

[Copy for LLMs](https://scripts.nuxt.com/scripts/google-maps.md)

[**Google Maps**](https://maps.google.com/) provides interactive and static maps for websites.

Nuxt Scripts provides a [`**useScriptGoogleMaps()**`](https://scripts.nuxt.com/scripts/google-maps/api/use-script-google-maps) composable and a headless [`**<ScriptGoogleMaps>**`](https://scripts.nuxt.com/scripts/google-maps/api/script-google-maps) component for working with Google Maps.

`**apiKey**``string`** required **

Your Google Maps API key.

`**libraries**``string[]` = \['places']

The Google Maps libraries to load.

`**language**``string`

The language code for the map UI and geocoding results.

`**region**``string`

The region code to bias geocoding results.

`**v**``'weekly' | 'quarterly' | 'beta' | 'alpha' | string` = 'weekly'

The Google Maps JS API version to load.

## Types

Install `**@types/google.maps**` for full TypeScript support.

```bash
pnpm add -D @types/google.maps
```

## Setup

Enable Google Maps in your `**nuxt.config**` and provide your API key via environment variable:

nuxt.config.ts

```ts
export default defineNuxtConfig({
  scripts: {
    registry: {
      // Register infrastructure without loading Maps on every page.
      // <ScriptGoogleMaps> will load it after its element trigger fires.
      googleMaps: {},
    },
  },
})
```

.env

```text
NUXT_PUBLIC_SCRIPTS_GOOGLE_MAPS_API_KEY=<YOUR_API_KEY>
```

Add `**trigger: 'onNuxtReady'**` to the registry entry only when you want the interactive Maps API to load globally. It bypasses the component's default interaction delay because the shared script instance is already loading.

The Maps JavaScript and Static Maps APIs send this key to the browser. Follow Google's [**API security guidance**](https://developers.google.com/maps/api-security-best-practices): apply a Websites application restriction, allow only the APIs this site uses, and configure quota limits. Runtime config keeps deployment values configurable; it does not make a `**NUXT_PUBLIC_**` key secret.

See [**Billing & Permissions**](https://scripts.nuxt.com/scripts/google-maps/guides/billing) for API costs and required permissions.

## Quick Start

```vue
<template>
  <ScriptGoogleMaps
    :map-options="{
      center: { lat: -33.8688, lng: 151.2093 },
      zoom: 12,
    }"
  />
</template>
```

See the [**Markers & Info Windows**](https://scripts.nuxt.com/scripts/google-maps/guides/markers-and-info-windows) guide for adding markers, popups, and custom content. See [**Shapes & Overlays**](https://scripts.nuxt.com/scripts/google-maps/guides/shapes-and-overlays) for drawing on the map.

[Edit this page](https://github.com/nuxt/scripts/edit/main/docs/content/google-maps/index.md)

[Markdown For LLMs](https://scripts.nuxt.com/scripts/google-maps.md)

[**\<ScriptGoogleMapsGeoJson>** Load inline or remote GeoJSON into a reactive Google Maps Data layer.](https://scripts.nuxt.com/scripts/google-maps/api/geojson) [**Google reCAPTCHA** Load score-based reCAPTCHA v3 or Enterprise and execute protected actions.](https://scripts.nuxt.com/scripts/google-recaptcha)

**On this page **

- [Types](#types)
- [Setup](#setup)
- [Quick Start](#quick-start)

```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/google-maps#webpage","@type":"WebPage","description":"Load interactive maps, static maps, and location search on demand.","name":"Google Maps","url":"https://scripts.nuxt.com/scripts/google-maps","breadcrumb":{"@id":"https://scripts.nuxt.com/scripts/google-maps#breadcrumb"},"isPartOf":{"@id":"https://scripts.nuxt.com/#website"},"potentialAction":[{"@type":"ReadAction","target":["https://scripts.nuxt.com/scripts/google-maps"]}],"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/google-maps#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":"Google Maps","item":"https://scripts.nuxt.com/scripts/google-maps","position":3}]},{"@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.
