Don't let the SVG renderer bail if the node we are trying to add is out of
bounds *and* not yet added to the map. r=pagameba (Closes #1274) git-svn-id: http://svn.openlayers.org/trunk/openlayers@5826 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -336,7 +336,9 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
node.setAttributeNS(null, "cy", y);
|
node.setAttributeNS(null, "cy", y);
|
||||||
node.setAttributeNS(null, "r", radius);
|
node.setAttributeNS(null, "r", radius);
|
||||||
} else {
|
} else {
|
||||||
this.root.removeChild(node);
|
if (node.parentNode == this.root) {
|
||||||
|
this.root.removeChild(node);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
t.plan(3);
|
t.plan(6);
|
||||||
|
|
||||||
var r = new OpenLayers.Renderer.SVG(document.body);
|
var r = new OpenLayers.Renderer.SVG(document.body);
|
||||||
r.resolution = 0.5;
|
r.resolution = 0.5;
|
||||||
@@ -146,6 +146,18 @@
|
|||||||
t.eq(node.getAttributeNS(null, 'cx'), '2', "cx is correct");
|
t.eq(node.getAttributeNS(null, 'cx'), '2', "cx is correct");
|
||||||
t.eq(node.getAttributeNS(null, 'cy'), '-4', "cy is correct");
|
t.eq(node.getAttributeNS(null, 'cy'), '-4', "cy is correct");
|
||||||
t.eq(node.getAttributeNS(null, 'r'), '3', "r is correct");
|
t.eq(node.getAttributeNS(null, 'r'), '3', "r is correct");
|
||||||
|
|
||||||
|
// #1274: out of bound node fails when first added
|
||||||
|
var geometry = {
|
||||||
|
x: 10000000,
|
||||||
|
y: 200000000
|
||||||
|
}
|
||||||
|
|
||||||
|
r.drawCircle(node, geometry, "blah_4000");
|
||||||
|
|
||||||
|
t.eq(node.getAttributeNS(null, 'cx'), '2', "cx is correct");
|
||||||
|
t.eq(node.getAttributeNS(null, 'cy'), '-4', "cy is correct");
|
||||||
|
t.eq(node.getAttributeNS(null, 'r'), '3', "r is correct");
|
||||||
}
|
}
|
||||||
|
|
||||||
function test_SVG_drawlinestring(t) {
|
function test_SVG_drawlinestring(t) {
|
||||||
@@ -365,4 +377,4 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="map" style="width:500px;height:550px"></div>
|
<div id="map" style="width:500px;height:550px"></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user