From 813d38a09a9c34b845821996879bca4162c41cdc Mon Sep 17 00:00:00 2001 From: danzel Date: Tue, 24 Jul 2012 09:18:30 +1200 Subject: [PATCH] Don't re-spiderfy if the same cluster is clicked twice --- src/MarkerCluster.Spiderfier.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/MarkerCluster.Spiderfier.js b/src/MarkerCluster.Spiderfier.js index 20795793f..39d386ae5 100644 --- a/src/MarkerCluster.Spiderfier.js +++ b/src/MarkerCluster.Spiderfier.js @@ -15,8 +15,11 @@ L.MarkerCluster.include({ // 0 -> always spiral; Infinity -> always circle spiderfy: function () { - var me = this, - childMarkers = this.getAllChildMarkers(), + if (this._group._spiderfied == this) { + return; + } + + var childMarkers = this.getAllChildMarkers(), group = this._group, map = group._map, center = map.latLngToLayerPoint(this._latlng),