Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

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

I am the developer of and use the google-maps-leaflet plugin from shramov to display google maps:

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:

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:

There is also an open issue for that on github - with a possibly better explanation of the problem:

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)


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?