NuxtJS module for Google Maps
- Load Google Maps JavaScript API script only when required (once
$gmaps()
is called) - TypeScript support
- Add
nuxt-maps
dependency to your project:
npm install nuxt-maps
- Add
nuxt-maps
module and configuration tonuxt.config.js
:
export default {
// ...other config options
modules: ["nuxt-maps"];
maps: {
apiKey: 'XXXXXXXXXXXXXXXXX',
}
}
- (Optional) TypeScript support. Add
nuxt-maps
to thetypes
section oftsconfig.json
:
{
"compilerOptions": {
"types": ["nuxt-maps"]
}
}
- Type:
String
Your Google API Key.
- Type:
Boolean
- Default:
false
Enable i18n-module integration.
...
See the LICENSE file for license rights and limitations (MIT).