[OpenLayers-Commits] r12230 - in trunk/openlayers: lib/OpenLayers theme/default

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Aug 10 04:29:33 EDT 2011


Author: ahocevar
Date: 2011-08-10 01:29:31 -0700 (Wed, 10 Aug 2011)
New Revision: 12230

Modified:
   trunk/openlayers/lib/OpenLayers/Layer.js
   trunk/openlayers/lib/OpenLayers/Map.js
   trunk/openlayers/theme/default/style.css
Log:
reverting r12185 (closes #3431)

Modified: trunk/openlayers/lib/OpenLayers/Layer.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer.js	2011-08-10 08:28:47 UTC (rev 12229)
+++ trunk/openlayers/lib/OpenLayers/Layer.js	2011-08-10 08:29:31 UTC (rev 12230)
@@ -347,8 +347,11 @@
             this.id = OpenLayers.Util.createUniqueID(this.CLASS_NAME + "_");
 
             this.div = OpenLayers.Util.createDiv(this.id);
-            this.div.style.width = "100%";
-            this.div.style.height = "100%";
+            var style = this.div.style;
+            style.width = "100%";
+            style.height = "100%";
+            style.overflow = "";
+            this.div.className = "olLayerDiv";
             this.div.dir = "ltr";
             if (this.opacity != null && this.opacity < 1) {
                 OpenLayers.Util.modifyDOMElement(
@@ -367,6 +370,19 @@
         if (this.wrapDateLine) {
             this.displayOutsideMaxExtent = true;
         }
+        
+        //TODO remove the if block below when we drop support for IE8.
+        if (parseInt(navigator.appVersion.split("MSIE")[1], 10) == 8) {
+            // Workaround for opacity handling in IE8 - also see
+            // .ie8-opacity-hack selectors in theme/default/style.css
+            this.events.register("loadend", this, function() {
+                var opacity = this.opacity;
+                if (opacity != null && opacity >= 0 && opacity < 1) {
+                    OpenLayers.Element.addClass(this.div, "ie8-opacity-hack");
+                    this.div.style.filter = "alpha(opacity=" + (opacity * 100) + ")";
+                }
+            });
+        }
     },
     
     /**

Modified: trunk/openlayers/lib/OpenLayers/Map.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Map.js	2011-08-10 08:28:47 UTC (rev 12229)
+++ trunk/openlayers/lib/OpenLayers/Map.js	2011-08-10 08:29:31 UTC (rev 12230)
@@ -971,8 +971,6 @@
         }
 
         
-        layer.div.className = "olLayerDiv";
-        layer.div.style.overflow = "";
         this.setLayerZIndex(layer, this.layers.length);
 
         if (layer.isFixed) {

Modified: trunk/openlayers/theme/default/style.css
===================================================================
--- trunk/openlayers/theme/default/style.css	2011-08-10 08:28:47 UTC (rev 12229)
+++ trunk/openlayers/theme/default/style.css	2011-08-10 08:29:31 UTC (rev 12230)
@@ -14,6 +14,15 @@
    -khtml-user-select: none;
 }
 
+/* TODO remove the two style definitions below when we drop support for IE8 */
+div.olLayerDiv.ie8-opacity-hack {
+    width: 9999px !important;
+    height: 9999px !important;
+}
+div.olLayerDiv.ie8-opacity-hack div, .ie8-opacity-hack img.olTileImage {
+    filter: inherit;
+}
+
 .olLayerGoogleCopyright {
     left: 2px;
     bottom: 2px;



More information about the Commits mailing list