Integrate Google Maps in your Vue application

Integrate Google Maps in your Vue application

This library is Work In Progress. More components will be available in the 1.0 release.


npm npm vue2

Integrate Google Maps in your Vue application in a "Vue-way".

This library is Work In Progress. More components will be available in the 1.0 release.

Live demo

The main objective of the library is to use Google Maps using Vue components in a way that feels natural to Vue developpers (with props, events, slots...).

Become a Patreon



VueSchool logo Vue Mastery logo


Table of Contents


npm i -S vue-googlemaps
yarn add vue-googlemaps

You need to polyfill some ES2015 features in old browsers.


You need a Google API key from the developer console.

import 'vue-googlemaps/dist/vue-googlemaps.css'
import VueGoogleMaps from 'vue-googlemaps'

Vue.use(VueGoogleMaps, {
  load: {
    // Google API key
    apiKey: 'your-google-api-key',
    // Enable more Google Maps libraries here
    libraries: ['places'],
    // Use new renderer
    useBetaRenderer: false,

Builtin components

(Documentation is work-in-progress)

  • Circle
  • Geocoder
  • Map
  • Marker
  • NearbyPlaces
  • PlaceDetails
  • UserPosition
  • More to come!

Create you own components

Here is an example of what a Marker component would look like:

import { MapElement } from 'vue-googlemaps'

// Those Vue props will update automatically
// (Two-way binding with .sync modifier)
const boundProps = [
  // ...

// Events from Google Maps emitted as Vue events
const redirectedEvents = [
  // ...

export default {
  mixins: [
    // You need to use this mixin

  // When Google Maps is ready
  googleMapsReady () {
    const options = Object.assign({}, this.$props) = this.$_map

    // Create Google Maps objects
    this.$_marker = new
    // Bind the Vue props
    this.bindProps(this.$_marker, boundProps)
    // Emit the events from Google Maps
    this.redirectEvents(this.$_marker, redirectedEvents)

  beforeDestroy () {
    // Teardown
    if (this.$_marker) {

Quick Examples

Map with markers


  <!-- User Position -->

    v-for="marker of markers"
      color: marker === currentmarker ? 'white' : 'black',
      fontFamily: 'Material Icons',
      fontSize: '20px',
      text: 'star_rate',

Place Details

    placeId: placeId
  @results="results => ..."
  <template slot-scope="props">
    <div class="name">{{ }}</div>
    <div class="address">{{ props.results.formatted_address }}</div>


    location: latLng,
  @results="results => ..."
  <template slot-scope="props">
    <div class="name">{{ props.results[1].name }}</div>
    <div class="address">{{ props.results[0].formatted_address }}</div>

Nearby places

  @idle="map => mapBounds = map.getBounds()"

    bounds: mapBounds
  :filter="result => !result.types.includes('locality')"
  @results="results => ..."
  <template slot-scope="props">
    <div v-if="props.loading">Loading...</div>

    <div v-for="result of props.result">
          :src="[0].getUrl({ maxWidth: 80, maxHeight: 80 })"
        {{ }}
      <div>{{ result.vicinity }}</div>

Github Repository

Tags: #VueJs #Maps