Adding px units where appropriate in style properties. Thanks Wally Atkins for the original patch. r=me (closes #1582)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7341 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -186,7 +186,7 @@ OpenLayers.Control.PanZoomBar = OpenLayers.Class(OpenLayers.Control.PanZoom, {
|
|||||||
this.zoomStopHeight),
|
this.zoomStopHeight),
|
||||||
imgLocation + "zoombar.png",
|
imgLocation + "zoombar.png",
|
||||||
"absolute", null, "crop");
|
"absolute", null, "crop");
|
||||||
div.style.height = sz.h;
|
div.style.height = sz.h + "px";
|
||||||
} else {
|
} else {
|
||||||
div = OpenLayers.Util.createDiv(
|
div = OpenLayers.Util.createDiv(
|
||||||
'OpenLayers_Control_PanZoomBar_Zoombar' + this.map.id,
|
'OpenLayers_Control_PanZoomBar_Zoombar' + this.map.id,
|
||||||
|
|||||||
@@ -95,8 +95,8 @@ OpenLayers.Layer.VirtualEarth = OpenLayers.Class(
|
|||||||
// create div and set to same size as map
|
// create div and set to same size as map
|
||||||
var veDiv = OpenLayers.Util.createDiv(this.name);
|
var veDiv = OpenLayers.Util.createDiv(this.name);
|
||||||
var sz = this.map.getSize();
|
var sz = this.map.getSize();
|
||||||
veDiv.style.width = sz.w;
|
veDiv.style.width = sz.w + "px";
|
||||||
veDiv.style.height = sz.h;
|
veDiv.style.height = sz.h + "px";
|
||||||
this.div.appendChild(veDiv);
|
this.div.appendChild(veDiv);
|
||||||
|
|
||||||
try { // crash prevention
|
try { // crash prevention
|
||||||
|
|||||||
@@ -98,11 +98,11 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
setSize: function(size) {
|
setSize: function(size) {
|
||||||
OpenLayers.Renderer.prototype.setSize.apply(this, arguments);
|
OpenLayers.Renderer.prototype.setSize.apply(this, arguments);
|
||||||
|
|
||||||
this.rendererRoot.style.width = this.size.w;
|
this.rendererRoot.style.width = this.size.w + "px";
|
||||||
this.rendererRoot.style.height = this.size.h;
|
this.rendererRoot.style.height = this.size.h + "px";
|
||||||
|
|
||||||
this.root.style.width = this.size.w;
|
this.root.style.width = this.size.w + "px";
|
||||||
this.root.style.height = this.size.h;
|
this.root.style.height = this.size.h + "px";
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -169,8 +169,8 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
|
|
||||||
node.style.left = ((geometry.x/resolution)+xOffset).toFixed();
|
node.style.left = ((geometry.x/resolution)+xOffset).toFixed();
|
||||||
node.style.top = ((geometry.y/resolution)-(yOffset+height)).toFixed();
|
node.style.top = ((geometry.y/resolution)-(yOffset+height)).toFixed();
|
||||||
node.style.width = width;
|
node.style.width = width + "px";
|
||||||
node.style.height = height;
|
node.style.height = height + "px";
|
||||||
node.style.flip = "y";
|
node.style.flip = "y";
|
||||||
|
|
||||||
// modify style/options for fill and stroke styling below
|
// modify style/options for fill and stroke styling below
|
||||||
@@ -310,8 +310,8 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
|
|
||||||
var width = Math.round(style.graphicWidth || size * aspectRatio);
|
var width = Math.round(style.graphicWidth || size * aspectRatio);
|
||||||
var height = Math.round(style.graphicHeight || size);
|
var height = Math.round(style.graphicHeight || size);
|
||||||
node.style.width = width;
|
node.style.width = width + "px";
|
||||||
node.style.height = height;
|
node.style.height = height + "px";
|
||||||
|
|
||||||
// Three steps are required to remove artefacts for images with
|
// Three steps are required to remove artefacts for images with
|
||||||
// transparent backgrounds (resulting from using DXImageTransform
|
// transparent backgrounds (resulting from using DXImageTransform
|
||||||
@@ -327,8 +327,8 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
image = this.createNode("olv:imagedata", node.id + "_image");
|
image = this.createNode("olv:imagedata", node.id + "_image");
|
||||||
node.appendChild(image);
|
node.appendChild(image);
|
||||||
}
|
}
|
||||||
image.style.width = width;
|
image.style.width = width + "px";
|
||||||
image.style.height = height;
|
image.style.height = height + "px";
|
||||||
image.src = style.externalGraphic;
|
image.src = style.externalGraphic;
|
||||||
image.style.filter =
|
image.style.filter =
|
||||||
"progid:DXImageTransform.Microsoft.AlphaImageLoader(" +
|
"progid:DXImageTransform.Microsoft.AlphaImageLoader(" +
|
||||||
@@ -360,9 +360,9 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
var imgBounds = imgBox.getBounds();
|
var imgBounds = imgBox.getBounds();
|
||||||
|
|
||||||
node.style.left = Math.round(
|
node.style.left = Math.round(
|
||||||
parseInt(node.style.left) + imgBounds.left);
|
parseInt(node.style.left) + imgBounds.left) + "px";
|
||||||
node.style.top = Math.round(
|
node.style.top = Math.round(
|
||||||
parseInt(node.style.top) - imgBounds.bottom);
|
parseInt(node.style.top) - imgBounds.bottom) + "px";
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -411,10 +411,10 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
(bbox.top/resolution).toFixed());
|
(bbox.top/resolution).toFixed());
|
||||||
|
|
||||||
// Set the internal coordinate system to draw the path
|
// Set the internal coordinate system to draw the path
|
||||||
node.style.left = scaledBox.left;
|
node.style.left = scaledBox.left + "px";
|
||||||
node.style.top = scaledBox.top;
|
node.style.top = scaledBox.top + "px";
|
||||||
node.style.width = scaledBox.getWidth();
|
node.style.width = scaledBox.getWidth() + "px";
|
||||||
node.style.height = scaledBox.getHeight();
|
node.style.height = scaledBox.getHeight() + "px";
|
||||||
|
|
||||||
node.coordorigin = scaledBox.left + " " + scaledBox.top;
|
node.coordorigin = scaledBox.left + " " + scaledBox.top;
|
||||||
node.coordsize = scaledBox.getWidth()+ " " + scaledBox.getHeight();
|
node.coordsize = scaledBox.getWidth()+ " " + scaledBox.getHeight();
|
||||||
@@ -530,13 +530,13 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
if(!isNaN(geometry.x)&& !isNaN(geometry.y)) {
|
if(!isNaN(geometry.x)&& !isNaN(geometry.y)) {
|
||||||
var resolution = this.getResolution();
|
var resolution = this.getResolution();
|
||||||
|
|
||||||
node.style.left = (geometry.x /resolution).toFixed() - radius;
|
node.style.left = ((geometry.x /resolution).toFixed() - radius) + "px";
|
||||||
node.style.top = (geometry.y /resolution).toFixed() - radius;
|
node.style.top = ((geometry.y /resolution).toFixed() - radius) + "px";
|
||||||
|
|
||||||
var diameter = radius * 2;
|
var diameter = radius * 2;
|
||||||
|
|
||||||
node.style.width = diameter;
|
node.style.width = diameter + "px";
|
||||||
node.style.height = diameter;
|
node.style.height = diameter + "px";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -638,10 +638,10 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
drawRectangle: function(node, geometry) {
|
drawRectangle: function(node, geometry) {
|
||||||
var resolution = this.getResolution();
|
var resolution = this.getResolution();
|
||||||
|
|
||||||
node.style.left = geometry.x/resolution;
|
node.style.left = geometry.x/resolution + "px";
|
||||||
node.style.top = geometry.y/resolution;
|
node.style.top = geometry.y/resolution + "px";
|
||||||
node.style.width = geometry.width/resolution;
|
node.style.width = geometry.width/resolution + "px";
|
||||||
node.style.height = geometry.height/resolution;
|
node.style.height = geometry.height/resolution + "px";
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user