Custom marker component for vue 2 js google map

This component let user display custom html content on the map using Overlay. This component is an adaptation of the google map V3 overlay code sample with some great ideas from angularjs google map from this component

How to

Here is how to use this component

  • import the component and use it in your own vue map component
import GmapCustomMarker from 'vue2-gmap-custom-marker'; 


components: {
    'gmap-custom-marker': GmapCustomMarker
  :key=" + ( === ? '-force-refresh' : 0)"
  v-for="marker in places"
      <img src="" />
      <my-component :place="marker"></my-component>

At the moment, the component api looks like :

  • handles onClick callback and give as first argument the given prop :marker
methods: {
   placeClick (marker) {
       console.log('this marker was clicked', marker)
  • display places depending on their lng lat values
computed: {
   places () {
      return [
          latitude: 50.60229509638775, 
          longitude: 3.0247059387528408 
  • refresh management using vue key change (this is a kind of hack)
 :key=" + (marker.condition ? '-refresh-tag' : 0)"