Followup to #449: Missed part of the commit, which protects against doing

a checkImgURL on a tile which has been destroyed.


git-svn-id: http://svn.openlayers.org/trunk/openlayers@2092 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
crschmidt
2006-12-22 18:50:30 +00:00
parent 7e9eef8d07
commit 88ac5a803c

View File

@@ -143,9 +143,13 @@ OpenLayers.Tile.Image.prototype =
* @private
*/
checkImgURL: function () {
var loaded = this.layer.alpha ? this.imgDiv.firstChild.src : this.imgDiv.src;
if (loaded != this.url) {
this.imgDiv.style.display = "none";
// Sometimes our image will load after it has already been removed
// from the map, in which case this check is not needed.
if (this.layer) {
var loaded = this.layer.alpha ? this.imgDiv.firstChild.src : this.imgDiv.src;
if (loaded != this.url) {
this.imgDiv.style.display = "none";
}
}
},