Ticket #2265 (closed bug: duplicate)

Opened 4 years ago

Last modified 22 months ago

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

Util.js Download (45.5 KB) - added by mjungmann 4 years ago.
Util.js

Change History

Changed 4 years ago by mjungmann

Util.js

Changed 3 years ago by tschaub

  • state Awaiting User Feedback deleted
  • milestone changed from 2.8 Release to 2.9 Release

This only needs to be for 2.9 if it is a regression - I just didn't want it to stay targeted for 2.8.

Changed 22 months ago by ahocevar

  • status changed from new to closed
  • resolution set to duplicate

Addressed in #3419. Closing this one as duplicate.

Note: See TracTickets for help on using tickets.