An open API service indexing awesome lists of open source software.

https://github.com/williamdasilva/nuxt-google-maps-module

Inject Google Maps script
https://github.com/williamdasilva/nuxt-google-maps-module

google maps nuxt-module nuxtjs

Last synced: 4 months ago
JSON representation

Inject Google Maps script

Awesome Lists containing this project

README

          

# Nuxt Google Maps Module

[![npm (scoped with tag)](https://img.shields.io/npm/v/nuxt-google-maps-module/latest.svg?style=flat-square)](https://npmjs.com/package/nuxt-google-maps-module)
[![npm](https://img.shields.io/npm/dt/nuxt-google-maps-module.svg?style=flat-square)](https://npmjs.com/package/nuxt-google-maps-module)
[![js-airbnb-style](https://img.shields.io/badge/code_style-airbnb-brightgreen.svg?style=flat-square)](https://github.com/airbnb/javascript)

> A NuxtJS module to import Google maps script

## Table of Contents ##

* [Requirements](#requirements)
* [Install](#install)
* [Getting Started](#getting-started)
* [Usage](#usage)
* [License](#license)

## Requirements

* npm
* NuxtJS
* NodeJS

## Install

```bash
$ npm install --save nuxt-google-maps-module
```

## Getting Started

Add `nuxt-google-maps-module` to `modules` section of `nuxt.config.js`.
```js
{
modules: [
// Simple usage
'nuxt-google-maps-module',

// With options
['nuxt-google-maps-module', {
/* module options */
key: 'GOOGLE MAPS KEY', // Default
}],
]
}
```
or even
```js
{
modules: [
'nuxt-google-maps-module',
],
maps: {
key: 'GOOGLE MAPS KEY',
},
}
```

## Usage

Once configured in `nuxt.config.js`, you can use it in your components like:

```js
{
...
mounted() {
const autocomplete = new this.$google.maps.places.Autocomplete(inputElement,
{
types: ['geocode'],
},
);
},
...
}
```

## License

[MIT License](./LICENSE)