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

Adjust marker positions to be centered? #771

Closed kps1ny closed 3 years ago

kps1ny commented 3 years ago

This Vue mapping solution works really well, but it seems to assume the use of standard droplet markers, such that when positioning them their visible tip at the bottom center of the icon is what anchors to the lat/lng.

Is there a way to specify or shift markers such that they are centered on the lat/lng? For example, we have map marker icons that are 32px height and width, and we draw a line between them on the map. In most cases the result looks bad because the lines go to the bottom center of the icon, not to its middle. We'd like to be able to shift the icon down 16px so that the lines connect their centers.

If we can somehow adjust or convert the marker position latitude enough to make this happen that would be fine too, but how to adjust latitude, which can be in either hemisphere, according to the zoom level of the map so that the icon moves down 16px in all cases?

kps1ny commented 3 years ago

Found a way to do this via #143.