OpenLayers OpenLayers

Ticket #576: image.patch

File image.patch, 0.8 kB (added by euzuro, 2 years ago)

if the tile has an image, stop observing it.

  • lib/OpenLayers/Tile/Image.js

    old new  
    3232     *  
    3333     */ 
    3434    destroy: function() { 
    35         if ((this.imgDiv != null) && (this.imgDiv.parentNode == this.layer.div)) { 
    36             this.layer.div.removeChild(this.imgDiv); 
    37             this.imgDiv.map = null; 
     35        if (this.imgDiv != null)  { 
     36            OpenLayers.Event.stopObservingElement(this.imgDiv.id); 
     37            if (this.imgDiv.parentNode == this.layer.div) { 
     38                this.layer.div.removeChild(this.imgDiv); 
     39                this.imgDiv.map = null; 
     40            } 
    3841        } 
    3942        this.imgDiv = null; 
    4043        OpenLayers.Tile.prototype.destroy.apply(this, arguments);