[OpenLayers-Commits] r7341 - in trunk/openlayers/lib/OpenLayers: Control Layer Renderer

commits at openlayers.org commits at openlayers.org
Tue Jun 10 16:39:03 EDT 2008


Author: tschaub
Date: 2008-06-10 16:39:03 -0400 (Tue, 10 Jun 2008)
New Revision: 7341

Modified:
   trunk/openlayers/lib/OpenLayers/Control/PanZoomBar.js
   trunk/openlayers/lib/OpenLayers/Layer/VirtualEarth.js
   trunk/openlayers/lib/OpenLayers/Renderer/VML.js
Log:
Adding px units where appropriate in style properties.  Thanks Wally Atkins for the original patch.  r=me (closes #1582)

Modified: trunk/openlayers/lib/OpenLayers/Control/PanZoomBar.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Control/PanZoomBar.js	2008-06-10 20:25:08 UTC (rev 7340)
+++ trunk/openlayers/lib/OpenLayers/Control/PanZoomBar.js	2008-06-10 20:39:03 UTC (rev 7341)
@@ -186,7 +186,7 @@
                                               this.zoomStopHeight),
                                       imgLocation + "zoombar.png", 
                                       "absolute", null, "crop");
-            div.style.height = sz.h;
+            div.style.height = sz.h + "px";
         } else {
             div = OpenLayers.Util.createDiv(
                         'OpenLayers_Control_PanZoomBar_Zoombar' + this.map.id,

Modified: trunk/openlayers/lib/OpenLayers/Layer/VirtualEarth.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Layer/VirtualEarth.js	2008-06-10 20:25:08 UTC (rev 7340)
+++ trunk/openlayers/lib/OpenLayers/Layer/VirtualEarth.js	2008-06-10 20:39:03 UTC (rev 7341)
@@ -95,8 +95,8 @@
         // create div and set to same size as map
         var veDiv = OpenLayers.Util.createDiv(this.name);
         var sz = this.map.getSize();
-        veDiv.style.width = sz.w;
-        veDiv.style.height = sz.h;
+        veDiv.style.width = sz.w + "px";
+        veDiv.style.height = sz.h + "px";
         this.div.appendChild(veDiv);
 
         try { // crash prevention

Modified: trunk/openlayers/lib/OpenLayers/Renderer/VML.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Renderer/VML.js	2008-06-10 20:25:08 UTC (rev 7340)
+++ trunk/openlayers/lib/OpenLayers/Renderer/VML.js	2008-06-10 20:39:03 UTC (rev 7341)
@@ -98,11 +98,11 @@
     setSize: function(size) {
         OpenLayers.Renderer.prototype.setSize.apply(this, arguments);
 
-        this.rendererRoot.style.width = this.size.w;
-        this.rendererRoot.style.height = this.size.h;
+        this.rendererRoot.style.width = this.size.w + "px";
+        this.rendererRoot.style.height = this.size.h + "px";
 
-        this.root.style.width = this.size.w;
-        this.root.style.height = this.size.h;
+        this.root.style.width = this.size.w + "px";
+        this.root.style.height = this.size.h + "px";
     },
 
     /**
@@ -169,8 +169,8 @@
                 
                 node.style.left = ((geometry.x/resolution)+xOffset).toFixed();
                 node.style.top = ((geometry.y/resolution)-(yOffset+height)).toFixed();
-                node.style.width = width;
-                node.style.height = height;    
+                node.style.width = width + "px";
+                node.style.height = height + "px";
                 node.style.flip = "y";
                 
                 // modify style/options for fill and stroke styling below
@@ -310,8 +310,8 @@
         
         var width = Math.round(style.graphicWidth || size * aspectRatio);
         var height = Math.round(style.graphicHeight || size);
-        node.style.width = width;
-        node.style.height = height;
+        node.style.width = width + "px";
+        node.style.height = height + "px";
         
         // Three steps are required to remove artefacts for images with
         // transparent backgrounds (resulting from using DXImageTransform
@@ -327,8 +327,8 @@
             image = this.createNode("olv:imagedata", node.id + "_image");
             node.appendChild(image);
         }
-        image.style.width = width;
-        image.style.height = height;
+        image.style.width = width + "px";
+        image.style.height = height + "px";
         image.src = style.externalGraphic;
         image.style.filter =
             "progid:DXImageTransform.Microsoft.AlphaImageLoader(" + 
@@ -360,9 +360,9 @@
         var imgBounds = imgBox.getBounds();
 
         node.style.left = Math.round(
-            parseInt(node.style.left) + imgBounds.left);
+            parseInt(node.style.left) + imgBounds.left) + "px";
         node.style.top = Math.round(
-            parseInt(node.style.top) - imgBounds.bottom);
+            parseInt(node.style.top) - imgBounds.bottom) + "px";
     },
 
     /**
@@ -411,10 +411,10 @@
                                       (bbox.top/resolution).toFixed());
             
             // Set the internal coordinate system to draw the path
-            node.style.left = scaledBox.left;
-            node.style.top = scaledBox.top;
-            node.style.width = scaledBox.getWidth();
-            node.style.height = scaledBox.getHeight();
+            node.style.left = scaledBox.left + "px";
+            node.style.top = scaledBox.top + "px";
+            node.style.width = scaledBox.getWidth() + "px";
+            node.style.height = scaledBox.getHeight() + "px";
     
             node.coordorigin = scaledBox.left + " " + scaledBox.top;
             node.coordsize = scaledBox.getWidth()+ " " + scaledBox.getHeight();
@@ -530,13 +530,13 @@
         if(!isNaN(geometry.x)&& !isNaN(geometry.y)) {
             var resolution = this.getResolution();
         
-            node.style.left = (geometry.x /resolution).toFixed() - radius;
-            node.style.top = (geometry.y /resolution).toFixed() - radius;
+            node.style.left = ((geometry.x /resolution).toFixed() - radius) + "px";
+            node.style.top = ((geometry.y /resolution).toFixed() - radius) + "px";
     
             var diameter = radius * 2;
             
-            node.style.width = diameter;
-            node.style.height = diameter;
+            node.style.width = diameter + "px";
+            node.style.height = diameter + "px";
         }
     },
 
@@ -638,10 +638,10 @@
     drawRectangle: function(node, geometry) {
         var resolution = this.getResolution();
     
-        node.style.left = geometry.x/resolution;
-        node.style.top = geometry.y/resolution;
-        node.style.width = geometry.width/resolution;
-        node.style.height = geometry.height/resolution;
+        node.style.left = geometry.x/resolution + "px";
+        node.style.top = geometry.y/resolution + "px";
+        node.style.width = geometry.width/resolution + "px";
+        node.style.height = geometry.height/resolution + "px";
     },
 
     /**



More information about the Commits mailing list