I’m using GMap API v3 and Fluster2 to create a map with clustered markers on it. Everything is fine with adding markers and have them show up as clusters depending on the zoom level.
However, I am having a problem when it’s time to clear all the markers so that I can add new ones (based on user input).
while(overlays[0]){
overlays.pop().setMap(null);
}
I am using the following code to clear the markers, unfortunately, it only affects the markers (overlays) that are not found within a cluster at the selected zoom level.
Does anyone know how I can remove all markers from the map, meaning all current markers (overlays) showing at the current zoom level AND all other markers found within clusters.
I’ve decided to simply create a new map and get rid of the old one.