Ticket #2265 (closed bug: duplicate)
For use with IE6 on singletile layers, the page will be loaded two or more times
| Reported by: | mjungmann | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 2.12 Release |
| Component: | Util | Version: | 2.8 |
| Keywords: | alphahack, ie6 | Cc: | |
| State: |
Description
Problem: If you use IE6 for a singletile layer, for example a mapguide layer, the page will be loaded two or more times. For reproducing, log the requests on your page.
Reason: IE6 can't load an empty source in DXImageTransform.Microsoft.AlphaImageLoader.
Solution: Before loading this filter, check if an image source exists.
Code: The modified function is below:
OpenLayers.Util.modifyAlphaImageDiv = function(div, id, px, sz, imgURL,
position, border, sizing,
opacity) {
OpenLayers.Util.modifyDOMElement(div, id, px, sz, position,
null, null, opacity);
var img = div.childNodes[0];
if (imgURL) {
img.src = imgURL;
}
OpenLayers.Util.modifyDOMElement(img, div.id + "_innerImage", null, sz,
"relative", border);
if (OpenLayers.Util.alphaHack()) {
if(div.style.display != "none") {
div.style.display = "inline-block";
}
if (sizing == null) {
sizing = "scale";
}
div.style.filter = "";
if(img.src) {
div.style.filter += "progid:DXImageTransform.Microsoft" +
".AlphaImageLoader(src='" + img.src + "', " +
"sizingMethod='" + sizing + "')";
}
if (parseFloat(div.style.opacity) >= 0.0 &&
parseFloat(div.style.opacity) < 1.0) {
div.style.filter += " alpha(opacity=" + div.style.opacity * 100 + ")";
}
img.style.filter = "alpha(opacity=0)";
}
};
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

