Make sure we do not make abandoned tiles visible

This commit is contained in:
ahocevar
2012-11-05 10:43:05 +01:00
parent 796a349c61
commit 65fa1aaa2d

View File

@@ -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;