The SVG renderer allows for rendering of null geometries. The VML renderer does not. This change gives us cross-brower consistency in the case of null geometries (closes #968).
git-svn-id: http://svn.openlayers.org/trunk/openlayers@4273 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -264,23 +264,24 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
||||
setNodeDimension: function(node, geometry) {
|
||||
|
||||
var bbox = geometry.getBounds();
|
||||
|
||||
var resolution = this.getResolution();
|
||||
|
||||
var scaledBox =
|
||||
new OpenLayers.Bounds((bbox.left/resolution).toFixed(),
|
||||
(bbox.bottom/resolution).toFixed(),
|
||||
(bbox.right/resolution).toFixed(),
|
||||
(bbox.top/resolution).toFixed());
|
||||
if(bbox) {
|
||||
var resolution = this.getResolution();
|
||||
|
||||
// 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.coordorigin = scaledBox.left + " " + scaledBox.top;
|
||||
node.coordsize = scaledBox.getWidth()+ " " + scaledBox.getHeight();
|
||||
var scaledBox =
|
||||
new OpenLayers.Bounds((bbox.left/resolution).toFixed(),
|
||||
(bbox.bottom/resolution).toFixed(),
|
||||
(bbox.right/resolution).toFixed(),
|
||||
(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.coordorigin = scaledBox.left + " " + scaledBox.top;
|
||||
node.coordsize = scaledBox.getWidth()+ " " + scaledBox.getHeight();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -387,16 +388,17 @@ OpenLayers.Renderer.VML = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
||||
* radius - {float}
|
||||
*/
|
||||
drawCircle: function(node, geometry, radius) {
|
||||
|
||||
var resolution = this.getResolution();
|
||||
|
||||
node.style.left = (geometry.x /resolution).toFixed() - radius;
|
||||
node.style.top = (geometry.y /resolution).toFixed() - radius;
|
||||
|
||||
var diameter = radius * 2;
|
||||
if(!isNaN(geometry.x)&& !isNaN(geometry.y)) {
|
||||
var resolution = this.getResolution();
|
||||
|
||||
node.style.width = diameter;
|
||||
node.style.height = diameter;
|
||||
node.style.left = (geometry.x /resolution).toFixed() - radius;
|
||||
node.style.top = (geometry.y /resolution).toFixed() - radius;
|
||||
|
||||
var diameter = radius * 2;
|
||||
|
||||
node.style.width = diameter;
|
||||
node.style.height = diameter;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user