add Vector.destroyFeatures() and call it from WFS.moveTo(), which keeps WFS

from loading the same set of features multiple times. Includes tests. fixes
#622.



git-svn-id: http://svn.openlayers.org/trunk/openlayers@2996 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Schuyler Erle
2007-04-03 21:02:59 +00:00
parent 23131012dd
commit 45407e9eda
3 changed files with 26 additions and 1 deletions

View File

@@ -262,6 +262,14 @@ OpenLayers.Layer.Vector.prototype =
}
},
/**
*/
destroyFeatures: function () {
for (var i = this.features.length - 1; i >= 0; i--) {
this.features[i].destroy();
}
},
/**
* @param {String} fid
* @param {Object} style

View File

@@ -188,6 +188,7 @@ OpenLayers.Layer.WFS.prototype =
this.tile.draw();
} else {
if (this.vectorMode) {
this.destroyFeatures();
this.renderer.clear();
} else {
this.clearMarkers();