From 95512dfa5aab12224a1a85fdb3b19073d3ef4be4 Mon Sep 17 00:00:00 2001 From: Tim Schaub Date: Thu, 2 Sep 2010 18:29:06 +0000 Subject: [PATCH] The cluster strategy originally destroyed all features on the layer because it created them. When the threshold property was introduced, the strategy should have been removing instead of destroying features that it didn't create. This wasn't a problem until r10597 when the destroyMethod method was made to actually work. With this change, the cluster strategy removes instead of destroys features. r=crschmidt (closes #2815). git-svn-id: http://svn.openlayers.org/trunk/openlayers@10714 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Strategy/Cluster.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OpenLayers/Strategy/Cluster.js b/lib/OpenLayers/Strategy/Cluster.js index 455ff29ef9..a97eed1470 100644 --- a/lib/OpenLayers/Strategy/Cluster.js +++ b/lib/OpenLayers/Strategy/Cluster.js @@ -159,7 +159,7 @@ OpenLayers.Strategy.Cluster = OpenLayers.Class(OpenLayers.Strategy, { feature = this.features[i]; if(feature.geometry) { clustered = false; - for(var j=0; j=0; --j) { cluster = clusters[j]; if(this.shouldCluster(cluster, feature)) { this.addToCluster(cluster, feature); @@ -172,7 +172,7 @@ OpenLayers.Strategy.Cluster = OpenLayers.Class(OpenLayers.Strategy, { } } } - this.layer.destroyFeatures(); + this.layer.removeAllFeatures(); if(clusters.length > 0) { if(this.threshold > 1) { var clone = clusters.slice();