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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user