[OpenLayers-Commits] r5095 - in sandbox/pagameba/transition/lib/OpenLayers: . Tile

commits at openlayers.org commits at openlayers.org
Thu Nov 1 14:41:13 EDT 2007


Author: pagameba
Date: 2007-11-01 14:41:13 -0400 (Thu, 01 Nov 2007)
New Revision: 5095

Modified:
   sandbox/pagameba/transition/lib/OpenLayers/Tile/Image.js
   sandbox/pagameba/transition/lib/OpenLayers/Util.js
Log:
patch for handling alpha layers in ie properly with the other transition changes

Modified: sandbox/pagameba/transition/lib/OpenLayers/Tile/Image.js
===================================================================
--- sandbox/pagameba/transition/lib/OpenLayers/Tile/Image.js	2007-11-01 16:13:43 UTC (rev 5094)
+++ sandbox/pagameba/transition/lib/OpenLayers/Tile/Image.js	2007-11-01 18:41:13 UTC (rev 5095)
@@ -66,7 +66,11 @@
      */
     destroy: function() {
         if (this.imgDiv != null)  {
-            OpenLayers.Event.stopObservingElement(this.imgDiv.id);
+            if (this.layer.alpha) {
+                OpenLayers.Event.stopObservingElement(this.imgDiv.childNodes[0].id);                
+            }else {
+                OpenLayers.Event.stopObservingElement(this.imgDiv.id);
+            }
             if (this.imgDiv.parentNode == this.frame) {
                 this.frame.removeChild(this.imgDiv);
                 this.imgDiv.map = null;
@@ -173,7 +177,7 @@
     clear: function() {
         if(this.imgDiv) {
             this.hide();
-            this.imgDiv.src = OpenLayers.Util.getImagesLocation() + "blank.gif";
+            //this.imgDiv.src = OpenLayers.Util.getImagesLocation() + "blank.gif";
         }
     },
 
@@ -243,8 +247,13 @@
                 this.events.triggerEvent("loadend"); 
             }
         };
-        OpenLayers.Event.observe(this.imgDiv, 'load',
+        if (this.layer.alpha) {
+            OpenLayers.Event.observe(this.imgDiv.childNodes[0], 'load',
+                                     OpenLayers.Function.bind(onload, this));   
+        } else {
+            OpenLayers.Event.observe(this.imgDiv, 'load',
                                  OpenLayers.Function.bind(onload, this));
+        }
 
     },
 

Modified: sandbox/pagameba/transition/lib/OpenLayers/Util.js
===================================================================
--- sandbox/pagameba/transition/lib/OpenLayers/Util.js	2007-11-01 16:13:43 UTC (rev 5094)
+++ sandbox/pagameba/transition/lib/OpenLayers/Util.js	2007-11-01 18:41:13 UTC (rev 5095)
@@ -419,10 +419,10 @@
                            ".AlphaImageLoader(src='" + img.src + "', " +
                            "sizingMethod='" + sizing + "')";
         if (div.style.opacity) {
-            div.runtimeStyle.filter += " alpha(opacity=" + div.style.opacity * 100 + ")";
+            div.style.filter += " alpha(opacity=" + div.style.opacity * 100 + ")";
         }
 
-        img.runtimeStyle.filter = "progid:DXImageTransform.Microsoft" +
+        img.style.filter = "progid:DXImageTransform.Microsoft" +
                                 ".Alpha(opacity=0)";
     }
 };



More information about the Commits mailing list