[GIS] Leaflet Marker Cluster: refreshCluster function issue

clusteringjavascriptleafletweb-mapping

I am trying to use the markers.refreshClusters(); function to refresh the marker icons for a new styled icon I am trying to work with to highlight the selected cluster. Unfortunately, I keep getting the markers.refreshClusters is not a function error. Is there a file I am missing for the marker cluster plug-in? I tried updating to latest revision of plug-in but it seems I have the latest.

Best Answer

I just wrote the refreshClusters() method a few weeks ago. Unfortunately it did not make it yet to the distributed version on GitHub nor to the one provided by MapBox, even though the documentation already mentions it.

You can easily add it yourself by copying the code into your script. Just make sure to include it before calling the method.

Demo: http://jsfiddle.net/0ab2hm67/3/

Definitely this new method is helpful to more and more people. Please feel free to ask for a new version to include it by posting on the library issue page.