googlearchive / js-marker-clusterer

A marker clustering library for the Google Maps JavaScript API v3.
https://googlemaps.github.io/js-marker-clusterer/docs/reference.html
Apache License 2.0
1.28k stars 775 forks source link

Panning the map with the dragging starting on cluster marker provoke a zoom #136

Closed chifret closed 6 years ago

chifret commented 6 years ago

Hi,

I've noticed that when panning the map, if the initial click of the dragging happens on a cluster marker, it provoke a zoom when the draggins ends. So, the dragging event is handled as a click for the cluster marker.

I don't know if that's intended, but other google maps controlers don't work the same way. Maybe a propagation issue somewhere ?

Thanks for the great job done btw !

hassam7 commented 6 years ago

@chifret I think this repo is not maintained anymore. The most active repo which I found is:Gmap Marker Clusterer Plus

Anyway I was havin some problem this stackoverflow answer helped me, basically you need to add this code google.maps.event.addListener(map,'dragstart',function(){ mc.zoomOnClick_=false;}); google.maps.event.addListener(map,'mouseup',function(){setTimeout(function(){ mc.zoomOnClick_=true;},50);});

Also see this: https://code.google.com/archive/p/google-maps-utility-library-v3/issues/157

chifret commented 6 years ago

You're right, it's even marked so on the GitHub description...

Thanks for the mention, and for the code. The lil' hack will serve :)