xkjyeah / vue-google-maps

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

Setting :draggable to false does not work on markers #790

Open AIjbillinger opened 2 years ago

AIjbillinger commented 2 years ago

I have a bunch of markers in a map, however setting draggable to false does not seem to change anything. Idealy this would stop the functionality completely and I'm unable to find any other examples that do not have this issue.

As a reference this is the code part I'm using:

<GmapMap
      :center="{ lat: 40, lng: 9 }"
      :zoom="4"
      map-type-id="terrain"
      style="width: 100%; height: 31vh"
      :options="{
          zoomControl: false,
          mapTypeControl: false,
          scaleControl: false,
          streetViewControl: false,
          rotateControl: false,
          fullscreenControl: false,
          disableDefaultUI: false,
      }"
  >
 <GmapMarker
        :key="index"
        v-for="(m, index) in markers"
        :position="m"
        :draggable="false"
        :label="m.label"
    />
</GmapMap>
linhntbhsoft commented 2 years ago

@AIjbillinger We can use gestureHandling instead draggable https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.draggable