I am currently using markercluster plugin with jquery ui maps.
I have two arrays one of all markers (called markers) and one of markers that match search criteria (called current_markers). These are fitered from the first array.
I then draw the current_markers on screen.
I am finding however that the markerclusterer library is not updating based on this change.
So how can I update the markerclusterer?
Is it possible to assign the markerclusterer to a variable and call an update function?
You should store the marker object in a var and then unset the map as following:
after you’ve done this, you could init a
new MarkerClustererwith new markersUpdate
since you are using google maps ui plugin here’s some additional code. I’ve added a click even on a button with class
reset_markerclusterofcourse this is just to show how to use it to call the map