Ask your WordPress questions! Pay money and get answers fast! (more info)

leaflet google maps plugin: how to avoid "marker sliding effect"? WordPress

I am the developer of www.mapsmarker.com and use the google-maps-leaflet plugin from shramov to display google maps: https://github.com/shramov/leaflet-plugins

I actually added his file google.js from /leaflet-plugins/layer/tiles/ to my /leaflet-dist/leaflet.js file which enables using google maps as basemaps for my maps. See an example here: http://current.mapsmarker.com/2013/01/01/adsense-test/

When you zoom in or out of the map, there is a lag between the map and the marker. Try zooming out on an alternative basemap for comparison:
http://current.mapsmarker.com/2013/02/19/jquery-and-leaflet-0-4-5/

There is also an open issue for that on github - with a possibly better explanation of the problem: https://github.com/shramov/leaflet-plugins/issues/66

My goal: I would like google maps to also be synchronized as all other map providers on zooming in/out.

Attached the current version of my plugin for debugging which includes the un-minified google maps javascript in /leaflet-dist/leaflet.js.

Anyone know how to solve this?

Answers (1)

2013-04-22

Ross Wilson answers:

So it's not a pretty solution, but because of the difference in the zoom animation for google maps it might be the best. You should set markerZoomAnimation to false in the options of the map. You should be able to do this by adding it to the google maps plugin in the first few lines where there is a options object.


Robert Harm comments:

Hi Ross,
thanks, but that is already a workaround I got from github before posting this question. Any other ideas without interfering with the functionality?
best,
Robert