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) {
|
setNodeDimension: function(node, geometry) {
|
||||||
|
|
||||||
var bbox = geometry.getBounds();
|
var bbox = geometry.getBounds();
|
||||||
|
if(bbox) {
|
||||||
var resolution = this.getResolution();
|
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());
|
|
||||||
|
|
||||||
// Set the internal coordinate system to draw the path
|
var scaledBox =
|
||||||
node.style.left = scaledBox.left;
|
new OpenLayers.Bounds((bbox.left/resolution).toFixed(),
|
||||||
node.style.top = scaledBox.top;
|
(bbox.bottom/resolution).toFixed(),
|
||||||
node.style.width = scaledBox.getWidth();
|
(bbox.right/resolution).toFixed(),
|
||||||
node.style.height = scaledBox.getHeight();
|
(bbox.top/resolution).toFixed());
|
||||||
|
|
||||||
node.coordorigin = scaledBox.left + " " + scaledBox.top;
|
// Set the internal coordinate system to draw the path
|
||||||
node.coordsize = scaledBox.getWidth()+ " " + scaledBox.getHeight();
|
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}
|
* radius - {float}
|
||||||
*/
|
*/
|
||||||
drawCircle: function(node, geometry, radius) {
|
drawCircle: function(node, geometry, radius) {
|
||||||
|
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.top = (geometry.y /resolution).toFixed() - radius;
|
|
||||||
|
|
||||||
var diameter = radius * 2;
|
|
||||||
|
|
||||||
node.style.width = diameter;
|
node.style.left = (geometry.x /resolution).toFixed() - radius;
|
||||||
node.style.height = diameter;
|
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