[GIS] Loss of synchronization between map and markers (Leaflet + Google Maps)

google mapsleafletmarkers

I have a problem using the markers with Google Maps with Leaflet. In this example you can see the difference between Google Maps or OSM.

Using OSM, the marker moves with the map but when using Google Maps, it seems that the movement is not synchronized.

Another example of the same problem

Is there any known solution to this issue?

Best Answer

What you are describing is a well known issue with animation of Google basemap tiles in Leaflet, and unfortunately, I don't think there is an easy solution.

The map in the fiddle uses the Leaflet Google.js plugin by Pavel Shramov.

As explained in this answer by @mourner, this plugin "acts as a proxy to the original Google Maps API v3, so it doesn't work as smoothly as simple Leaflet tile layers, and unfortunately you can't use Google Maps tiles directly [in Leaflet] because of Terms of Use restrictions"

You could try the alternatives discussed here, but I think you will have the same problems with animation that you have now (looks very similar to the Shramov plugin).