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:
@@ -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
|
||||
|
||||
@@ -188,6 +188,7 @@ OpenLayers.Layer.WFS.prototype =
|
||||
this.tile.draw();
|
||||
} else {
|
||||
if (this.vectorMode) {
|
||||
this.destroyFeatures();
|
||||
this.renderer.clear();
|
||||
} else {
|
||||
this.clearMarkers();
|
||||
|
||||
Reference in New Issue
Block a user