Merge pull request #102 from tschaub/nowkt

Allow for builds without WKT format
This commit is contained in:
Tim Schaub
2011-12-14 09:51:06 -08:00
4 changed files with 70 additions and 22 deletions
+13
View File
@@ -334,6 +334,19 @@
t.geom_eq(wkt(cases[i].wkt), cases[i].geom, "case " + i);
}
}
function test_fromWKT_undefined(t) {
t.plan(1);
var WKT = OpenLayers.Format.WKT;
OpenLayers.Format.WKT = null;
delete OpenLayers.Geometry.fromWKT.format;
var geom = OpenLayers.Geometry.fromWKT("POINT(1 1)");
t.eq(geom, undefined, "undefined when OpenLayers.Format.WKT is not available");
OpenLayers.Format.WKT = WKT;
}
</script>
+15
View File
@@ -101,6 +101,21 @@
"toString() returns WKT" );
}
function test_Point_toString_no_wkt(t) {
t.plan(1);
var WKT = OpenLayers.Format.WKT;
OpenLayers.Format.WKT = null;
var x = 10;
var y = 20;
point = new OpenLayers.Geometry.Point(x, y);
t.eq(point.toString(), "[object Object]", "default string representation");
OpenLayers.Format.WKT = WKT;
}
function test_Point_move(t) {
t.plan(3);