Using CONSTANT_CASE for geometry type
This commit is contained in:
@@ -40,13 +40,13 @@ describe('ol.parser.WKT', function() {
|
||||
it('LineString read / written correctly', function() {
|
||||
var wkt = 'LINESTRING(30 10,10 30,40 40)';
|
||||
var geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getCoordinates()).to.eql([[30, 10], [10, 30], [40, 40]]);
|
||||
expect(parser.write(geom)).to.eql(wkt);
|
||||
// test whitespace when reading
|
||||
wkt = 'LINESTRING (30 10, 10 30, 40 40)';
|
||||
geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getCoordinates()).to.eql([[30, 10], [10, 30], [40, 40]]);
|
||||
});
|
||||
|
||||
@@ -54,10 +54,10 @@ describe('ol.parser.WKT', function() {
|
||||
var wkt = 'MULTILINESTRING((10 10,20 20,10 40),' +
|
||||
'(40 40,30 30,40 20,30 10))';
|
||||
var geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTILINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_LINE_STRING);
|
||||
var components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(components[0].getCoordinates()).to.eql(
|
||||
[[10, 10], [20, 20], [10, 40]]);
|
||||
expect(parser.write(geom)).to.eql(wkt);
|
||||
@@ -65,11 +65,11 @@ describe('ol.parser.WKT', function() {
|
||||
wkt = 'MULTILINESTRING ( (10 10, 20 20, 10 40), ' +
|
||||
'(40 40, 30 30, 40 20, 30 10) )';
|
||||
geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTILINESTRING);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_LINE_STRING);
|
||||
components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(components[0].getType()).to.eql(
|
||||
ol.geom.GeometryType.LINESTRING);
|
||||
ol.geom.GeometryType.LINE_STRING);
|
||||
expect(components[0].getCoordinates()).to.eql(
|
||||
[[10, 10], [20, 20], [10, 40]]);
|
||||
});
|
||||
@@ -80,7 +80,7 @@ describe('ol.parser.WKT', function() {
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
var rings = geom.getRings();
|
||||
expect(rings.length).to.eql(1);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEARRING);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[0].getCoordinates()).to.eql(
|
||||
[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]);
|
||||
expect(parser.write(geom)).to.eql(wkt);
|
||||
@@ -91,8 +91,8 @@ describe('ol.parser.WKT', function() {
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
var rings = geom.getRings();
|
||||
expect(rings.length).to.eql(2);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEARRING);
|
||||
expect(rings[1].getType()).to.eql(ol.geom.GeometryType.LINEARRING);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[1].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[0].getCoordinates()).to.eql(
|
||||
[[35, 10], [10, 20], [15, 40], [45, 45], [35, 10]]);
|
||||
expect(rings[1].getCoordinates()).to.eql(
|
||||
@@ -105,7 +105,7 @@ describe('ol.parser.WKT', function() {
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
var rings = geom.getRings();
|
||||
expect(rings.length).to.eql(1);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEARRING);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[0].getCoordinates()).to.eql(
|
||||
[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]);
|
||||
});
|
||||
@@ -115,7 +115,7 @@ describe('ol.parser.WKT', function() {
|
||||
var wkt = 'MULTIPOLYGON(((40 40,45 30,20 45,40 40)),' +
|
||||
'((20 35,45 20,30 5,10 10,10 30,20 35),(30 20,20 25,20 15,30 20)))';
|
||||
var geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTIPOLYGON);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_POLYGON);
|
||||
var components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
@@ -135,7 +135,7 @@ describe('ol.parser.WKT', function() {
|
||||
'( (20 35, 45 20,30 5,10 10,10 30,20 35), ' +
|
||||
'( 30 20, 20 25,20 15 ,30 20 ) ))';
|
||||
geom = parser.read(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTIPOLYGON);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_POLYGON);
|
||||
var components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
@@ -155,9 +155,9 @@ describe('ol.parser.WKT', function() {
|
||||
var geom = parser.read(wkt);
|
||||
var components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRYCOLLECTION);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRY_COLLECTION);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(components[1].getType()).to.eql(ol.geom.GeometryType.LINESTRING);
|
||||
expect(components[1].getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(components[0].getCoordinates()).to.eql([4, 6]);
|
||||
expect(components[1].getCoordinates()).to.eql([[4, 6], [7, 10]]);
|
||||
expect(parser.write(geom)).to.eql(wkt);
|
||||
@@ -166,10 +166,10 @@ describe('ol.parser.WKT', function() {
|
||||
geom = parser.read(wkt);
|
||||
components = geom.getComponents();
|
||||
expect(components.length).to.eql(2);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRYCOLLECTION);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRY_COLLECTION);
|
||||
expect(components[0].getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(components[1].getType()).to.eql(
|
||||
ol.geom.GeometryType.LINESTRING);
|
||||
ol.geom.GeometryType.LINE_STRING);
|
||||
expect(components[0].getCoordinates()).to.eql([4, 6]);
|
||||
expect(components[1].getCoordinates()).to.eql([[4, 6], [7, 10]]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user