Merge pull request #10 from elemoine/3061

IE<7 needs a reflow when the tiles are loaded
This commit is contained in:
Éric Lemoine
2011-10-09 01:31:21 -07:00

View File

@@ -346,6 +346,20 @@ OpenLayers.Tile.Image = OpenLayers.Class(OpenLayers.Tile.BackBufferable, {
this.isLoading = false;
this.events.triggerEvent("loadend");
// IE<7 needs a reflow when the tiles are loaded because of the
// percentage based positioning. Otherwise nothing is shown
// until the user interacts with the map in some way.
if (parseFloat(navigator.appVersion.split("MSIE")[1]) < 7 &&
this.layer && this.layer.div) {
var span = document.createElement("span");
span.style.display = "none";
var layerDiv = this.layer.div;
layerDiv.appendChild(span);
window.setTimeout(function() {
span.parentNode === layerDiv && span.parentNode.removeChild(span);
}, 0);
}
if (this.layerAlphaHack === true) {
img.style.filter =
"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" +