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

Hide cluster dynamically once all markers are hidden #31

Closed Remo closed 7 years ago

Remo commented 8 years ago

I'm using a toggle button to hide/show certain markers. Those that are part of a cluster have a problem. If I dyncamically hide marker.setVisible(false/true) all markers of a cluster the cluster stays visible.

I tried to call redraw and repaint, but both methods don't seem to consider the visibility of the marker. Any ideas about the correct way to do that?

Remo commented 8 years ago

Created a PR that works so far, requires more testing, CLA and so on.. Code will only work if repaint is called after changing the markers visibility

Remo commented 8 years ago

this PR does the trick for me https://github.com/googlemaps/js-marker-clusterer/pull/33

Remo commented 7 years ago

This has been implemented here https://github.com/gmaps-marker-clusterer/gmaps-marker-clusterer

zelds commented 7 years ago

Hi. Have same trouble while using https://developers.google.com/maps/documentation/javascript/examples/markerclusterer/markerclusterer.js ?

Remo commented 7 years ago

@zelds have you seen my comment above? You are using an unsupported version, try ours at https://github.com/gmaps-marker-clusterer/gmaps-marker-clusterer