OpenLayers OpenLayers

Changeset 2092

Show
Ignore:
Timestamp:
12/22/06 13:50:30 (2 years ago)
Author:
crschmidt
Message:

Followup to #449: Missed part of the commit, which protects against doing
a checkImgURL on a tile which has been destroyed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/lib/OpenLayers/Tile/Image.js

    r2091 r2092  
    144144     */ 
    145145    checkImgURL: function () { 
    146         var loaded = this.layer.alpha ? this.imgDiv.firstChild.src : this.imgDiv.src; 
    147         if (loaded != this.url) { 
    148             this.imgDiv.style.display = "none"; 
     146        // Sometimes our image will load after it has already been removed 
     147        // from the map, in which case this check is not needed.   
     148        if (this.layer) { 
     149            var loaded = this.layer.alpha ? this.imgDiv.firstChild.src : this.imgDiv.src; 
     150            if (loaded != this.url) { 
     151                this.imgDiv.style.display = "none"; 
     152            } 
    149153        } 
    150154    },