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

Define anchor to custom marker icon #656

Open zecka opened 4 years ago

zecka commented 4 years ago

Hello I have following code to display my marker. But by default the anchor of marker is bottom center, any way to set anchor in the center of marker ?

<gmap-marker
    v-if="user.position"
    :position="user.position"
    @click="handleMarkerClick(user.position)"
    :icon="{ url: require('../assets/markers/marker-user.svg') }"
/>
wrabit commented 4 years ago

Have you tried adding other attributes alongside url?

(you'll have to check the format the google map methods return)

      size: ..,
      origin: ..,
      anchor: ..,
      scaledSize: ..
kps1ny commented 3 years ago

See #143 for a way to do this, which worked for me. @zecka