Make sure we do not make abandoned tiles visible
This commit is contained in:
@@ -381,9 +381,13 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile, {
|
||||
OpenLayers.Event.stopObservingElement(img);
|
||||
|
||||
OpenLayers.Animation.requestFrame(OpenLayers.Function.bind(function() {
|
||||
img.style.visibility = 'inherit';
|
||||
img.style.opacity = this.layer.opacity;
|
||||
this.events.triggerEvent("loadend");
|
||||
// make sure we are not destroyed and not being reused for a
|
||||
// different image
|
||||
if (this.imgDiv === img) {
|
||||
img.style.visibility = 'inherit';
|
||||
img.style.opacity = this.layer.opacity;
|
||||
this.events.triggerEvent("loadend");
|
||||
}
|
||||
}, this));
|
||||
|
||||
this.isLoading = false;
|
||||
|
||||
Reference in New Issue
Block a user