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:
@@ -58,6 +58,11 @@ OpenLayers.Feature.Vector.prototype =
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
|
if (this.layer) {
|
||||||
|
this.layer.removeFeatures(this);
|
||||||
|
this.layer = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.geometry = null;
|
this.geometry = null;
|
||||||
OpenLayers.Feature.prototype.destroy.apply(this, arguments);
|
OpenLayers.Feature.prototype.destroy.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user