xkjyeah / vue-google-maps

Google maps component for vue with 2-way data binding
https://xkjyeah.github.io/vue-google-maps/
1.88k stars 475 forks source link

Is it possible to remove the markers? #676

Closed Marinsan closed 4 years ago

Marinsan commented 4 years ago

Hello everyone, my question is, is there a way to remove default Google markers? Thanks

EMILO9 commented 4 years ago

Had the same question as you, found this solution. is this what you where looking for?

data () {
    return {
      mapStyle: [{
          "featureType": "poi",
          "elementType": "labels",
          "stylers": [
                { "visibility": "off" }
          ]
      }]
    }
  }

<GmapMap :options="mapStyle"></GmapMap>

This is just an example, the better way to do it would be to store all your styles + settings in a JSON file.

Marinsan commented 4 years ago

Hi, I forgot to close and comment on the solution I found. I had to pass the suppressmarkers inside the options to the DirectionsRender. Tan simple como esto. Thanks for your response.

data () {
    return {
      options: {
          suppressMarkers: true
      }
    }
  }

 <DirectionsRenderer :directions="directions" :options="options" />