diff --git a/src/markerclusterer.ts b/src/markerclusterer.ts index 6da5eb2e4..141a42422 100644 --- a/src/markerclusterer.ts +++ b/src/markerclusterer.ts @@ -179,7 +179,8 @@ export class MarkerClusterer extends OverlayViewSafe { }); // Allow algorithms to return flag on whether the clusters/markers have changed. - if (changed || changed == undefined) { + // But if the cluster amount hasnt changed dont rerender unnecessarily, since nothing has changed + if (clusters.length !== this.clusters.length && (changed || changed == undefined)) { // Accumulate the markers of the clusters composed of a single marker. // Those clusters directly use the marker. // Clusters with more than one markers use a group marker generated by a renderer. @@ -208,7 +209,7 @@ export class MarkerClusterer extends OverlayViewSafe { groupMarkers.push(cluster.marker); } } - + this.clusters = clusters; this.renderClusters();