If a vector feature has a layer and it is destroyed, remove the feature from

the layer, and reset the layer to null.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2971 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2007-04-02 11:19:32 +00:00
parent 201e4bb112
commit def14318a6

View File

@@ -58,6 +58,11 @@ OpenLayers.Feature.Vector.prototype =
*
*/
destroy: function() {
if (this.layer) {
this.layer.removeFeatures(this);
this.layer = null;
}
this.geometry = null;
OpenLayers.Feature.prototype.destroy.apply(this, arguments);
},