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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user