Patch to empty selectedFeatures when destroying all features from #665,

tschaub. This includes tests (hooray) and fixes issues with zooming a wfs
layer while you have a feature selected.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@3067 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-04-12 10:51:39 +00:00
parent 4ec005c06c
commit 1548a6c470
2 changed files with 6 additions and 2 deletions

View File

@@ -26,7 +26,7 @@ OpenLayers.Layer.Vector.prototype =
features: null,
/** @type Array(OpenLayers.Feature.Vector) */
selectedFeatures: [],
selectedFeatures: null,
/** @type {Boolean} */
reportError: true,
@@ -252,8 +252,10 @@ OpenLayers.Layer.Vector.prototype =
},
/**
* Destroy all features on the layer and empty the selected features array.
*/
destroyFeatures: function () {
this.selectedFeatures = new Array();
for (var i = this.features.length - 1; i >= 0; i--) {
this.features[i].destroy();
}