A bit of a dump, but an effective method ....
You can insert markers separately into the cluster cluster object and immediately (1) before and (2) after calling your .getTotalCluster () method to see if the newly added marker will fall into the cluster.
I use this method after getClusters () does not work for me, maybe I do not use it through jquery.
var old_cluster_val = markerCluster.getTotalClusters(); // <-----(1) markerCluster.addMarker( marker ); var new_cluster_val = markerCluster.getTotalClusters(); // <-----(2) if (old_cluster_val == new_cluster_val) { in_a_cluster.push(marker); } else { not_in_cluster.push( marker ); }
dklt source share