Allowing for WKT free builds.

The WKT format is used for converting geometries to and from string representations.  For builds that do not explicitly include the WKT format, the `OpenLayers.Geometry.fromWKT` returns `undefined`.
This commit is contained in:
tschaub
2011-12-10 16:36:53 -07:00
parent 038a34c4ad
commit 66de55ef9b
2 changed files with 46 additions and 22 deletions
+11
View File
@@ -334,6 +334,17 @@
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;
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>