From fc0b15ad45a1f6c23d9ae10c8149242adb84c894 Mon Sep 17 00:00:00 2001 From: ahocevar Date: Tue, 24 Apr 2012 08:06:40 -0400 Subject: [PATCH] Overriding onImageLoad to set the opacity on the correct element. --- lib/OpenLayers/Tile/Image/IFrame.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/OpenLayers/Tile/Image/IFrame.js b/lib/OpenLayers/Tile/Image/IFrame.js index 6a5a369598..f3e408e78a 100644 --- a/lib/OpenLayers/Tile/Image/IFrame.js +++ b/lib/OpenLayers/Tile/Image/IFrame.js @@ -196,6 +196,19 @@ OpenLayers.Tile.Image.IFrame = { OpenLayers.Tile.Image.prototype.setImgSrc.apply(this, arguments); } }, + + /** + * Method: onImageLoad + * Handler for the image onload event + */ + onImageLoad: function() { + //TODO de-uglify opacity handling + OpenLayers.Tile.Image.prototype.onImageLoad.apply(this, arguments); + if (this.useIFrame === true) { + this.imgDiv.style.opacity = 1; + this.frame.style.opacity = this.layer.opacity; + } + }, /** * Method: createBackBuffer