#611: let all geometry inherit toString from the superclass - geometry.toString returns well-known text based on Format.WKT.write()
git-svn-id: http://svn.openlayers.org/trunk/openlayers@2945 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -28,7 +28,9 @@
|
||||
t.plan(1);
|
||||
|
||||
line = new OpenLayers.Geometry.LineString(components);
|
||||
t.eq( line.toString(), components.toString(), "toString output checks in");
|
||||
t.eq(line.toString(),
|
||||
"LINESTRING(10 15,0 0)",
|
||||
"toString() returns WKT");
|
||||
}
|
||||
|
||||
function test_03_LineString_removeComponent(t) {
|
||||
@@ -56,7 +58,9 @@
|
||||
function test_04_LineString_move(t) {
|
||||
t.plan(4);
|
||||
|
||||
line = new OpenLayers.Geometry.LineString(components);
|
||||
var components = [new OpenLayers.Geometry.Point(10,15),
|
||||
new OpenLayers.Geometry.Point(0,0)];
|
||||
var line = new OpenLayers.Geometry.LineString(components);
|
||||
|
||||
var x0 = components[0].x;
|
||||
var y0 = components[0].y;
|
||||
|
||||
@@ -97,13 +97,6 @@
|
||||
t.eq(ring.getArea(), 100, "getArea works lovely");
|
||||
}
|
||||
|
||||
function test_05_LinearRing_toString(t) {
|
||||
t.plan(1);
|
||||
|
||||
ring = new OpenLayers.Geometry.LinearRing(components);
|
||||
t.eq( ring.toString(), components.toString() + ',' + components[0].toString(), "toString output is ok");
|
||||
}
|
||||
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
|
||||
@@ -60,7 +60,8 @@
|
||||
var y = 20;
|
||||
point = new OpenLayers.Geometry.Point(x, y);
|
||||
bounds = point.getBounds();
|
||||
t.eq( point.toString(), x + ", " + y, "toString() works" );
|
||||
t.eq(point.toString(), "POINT(" + x + " " + y + ")",
|
||||
"toString() returns WKT" );
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user