The getVertices method now returns all points, endpoints only, or all except endpoints. r=crschmidt (closes #1966)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@8945 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
Tim Schaub
2009-03-03 15:46:00 +00:00
parent 95206bdeae
commit 9e73bd82d7
7 changed files with 57 additions and 27 deletions

View File

@@ -202,7 +202,7 @@
function test_getVertices(t) {
t.plan(10);
t.plan(14);
var points = [
new OpenLayers.Geometry.Point(10, 20),
@@ -226,6 +226,14 @@
t.eq(nodes.length, 2, "[nodes only] of correct length length");
t.geom_eq(nodes[0], points[0], "[nodes only] first: correct geometry");
t.geom_eq(nodes[1], points[points.length-1], "[nodes only] last: correct geometry");
// no nodes
var nodes = line.getVertices(false);
t.ok(nodes instanceof Array, "[no nodes] got back an array");
t.eq(nodes.length, 2, "[no nodes] of correct length length");
t.geom_eq(nodes[0], points[1], "[no nodes] first: correct geometry");
t.geom_eq(nodes[1], points[2], "[no nodes] last: correct geometry");
}