OpenLayers OpenLayers

Changeset 2971

Show
Ignore:
Timestamp:
04/02/07 07:19:32 (2 years ago)
Author:
crschmidt
Message:

If a vector feature has a layer and it is destroyed, remove the feature from
the layer, and reset the layer to null.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Feature/Vector.js

    r2968 r2971  
    5959     */ 
    6060    destroy: function() { 
     61        if (this.layer) { 
     62            this.layer.removeFeatures(this); 
     63            this.layer = null; 
     64        } 
     65             
    6166        this.geometry = null; 
    6267        OpenLayers.Feature.prototype.destroy.apply(this, arguments);