Merge pull request #5429 from probins/testenums
Remove enums from tests
This commit is contained in:
@@ -328,7 +328,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Point);
|
||||
expect(obj.getCoordinates()).to.eql([10, 20]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(obj.getLayout()).to.eql('XY');
|
||||
});
|
||||
|
||||
it('parses XYZ point', function() {
|
||||
@@ -341,7 +341,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Point);
|
||||
expect(obj.getCoordinates()).to.eql([10, 20, 10]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
||||
expect(obj.getLayout()).to.eql('XYZ');
|
||||
});
|
||||
|
||||
it('parses XYM point', function() {
|
||||
@@ -354,7 +354,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Point);
|
||||
expect(obj.getCoordinates()).to.eql([10, 20, 10]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYM);
|
||||
expect(obj.getLayout()).to.eql('XYM');
|
||||
});
|
||||
|
||||
it('parses XYZM point', function() {
|
||||
@@ -368,7 +368,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Point);
|
||||
expect(obj.getCoordinates()).to.eql([10, 20, 0, 10]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZM);
|
||||
expect(obj.getLayout()).to.eql('XYZM');
|
||||
});
|
||||
|
||||
it('parses multipoint', function() {
|
||||
@@ -379,7 +379,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.MultiPoint);
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20], [20, 30]]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(obj.getLayout()).to.eql('XY');
|
||||
});
|
||||
|
||||
it('parses XYZ multipoint', function() {
|
||||
@@ -391,7 +391,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.MultiPoint);
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20, 0], [20, 30, 0]]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
||||
expect(obj.getLayout()).to.eql('XYZ');
|
||||
});
|
||||
|
||||
it('parses XYM multipoint', function() {
|
||||
@@ -403,7 +403,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.MultiPoint);
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20, 0], [20, 30, 0]]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYM);
|
||||
expect(obj.getLayout()).to.eql('XYM');
|
||||
});
|
||||
|
||||
it('parses XYZM multipoint', function() {
|
||||
@@ -416,7 +416,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.MultiPoint);
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20, 0, 1], [20, 30, 0, 1]]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZM);
|
||||
expect(obj.getLayout()).to.eql('XYZM');
|
||||
});
|
||||
|
||||
it('parses linestring', function() {
|
||||
@@ -427,7 +427,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.LineString);
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20], [30, 40]]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(obj.getLayout()).to.eql('XY');
|
||||
});
|
||||
|
||||
it('parses XYZ linestring', function() {
|
||||
@@ -438,7 +438,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.LineString);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
||||
expect(obj.getLayout()).to.eql('XYZ');
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20, 1534], [30, 40, 1420]]);
|
||||
});
|
||||
|
||||
@@ -450,7 +450,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.LineString);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYM);
|
||||
expect(obj.getLayout()).to.eql('XYM');
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20, 1534], [30, 40, 1420]]);
|
||||
});
|
||||
|
||||
@@ -463,7 +463,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.LineString);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZM);
|
||||
expect(obj.getLayout()).to.eql('XYZM');
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20, 1534, 1],
|
||||
[30, 40, 1420, 2]]);
|
||||
});
|
||||
@@ -482,7 +482,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
[[102.0, 0.0], [103.0, 1.0], [104.0, 0.0], [105.0, 1.0]],
|
||||
[[105.0, 3.0], [106.0, 4.0], [107.0, 3.0], [108.0, 4.0]]
|
||||
]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(obj.getLayout()).to.eql('XY');
|
||||
});
|
||||
|
||||
it('parses XYZ multilinestring', function() {
|
||||
@@ -500,7 +500,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
[[102.0, 0.0, 1], [103.0, 1.0, 1], [104.0, 0.0, 1], [105.0, 1.0, 1]],
|
||||
[[105.0, 3.0, 1], [106.0, 4.0, 1], [107.0, 3.0, 1], [108.0, 4.0, 1]]
|
||||
]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
||||
expect(obj.getLayout()).to.eql('XYZ');
|
||||
});
|
||||
|
||||
it('parses XYM multilinestring', function() {
|
||||
@@ -518,7 +518,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
[[102.0, 0.0, 1], [103.0, 1.0, 1], [104.0, 0.0, 1], [105.0, 1.0, 1]],
|
||||
[[105.0, 3.0, 1], [106.0, 4.0, 1], [107.0, 3.0, 1], [108.0, 4.0, 1]]
|
||||
]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYM);
|
||||
expect(obj.getLayout()).to.eql('XYM');
|
||||
});
|
||||
|
||||
it('parses XYZM multilinestring', function() {
|
||||
@@ -537,7 +537,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
[[102, 0, 1, 2], [103, 1, 1, 2], [104, 0, 1, 2], [105, 1, 1, 2]],
|
||||
[[105, 3, 1, 2], [106, 4, 1, 2], [107, 3, 1, 2], [108, 4, 1, 2]]
|
||||
]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZM);
|
||||
expect(obj.getLayout()).to.eql('XYZM');
|
||||
});
|
||||
|
||||
it('parses polygon', function() {
|
||||
@@ -549,7 +549,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Polygon);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(obj.getLayout()).to.eql('XY');
|
||||
var rings = obj.getLinearRings();
|
||||
expect(rings.length).to.be(3);
|
||||
expect(rings[0].getCoordinates()[0].length).to.equal(2);
|
||||
@@ -568,7 +568,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Polygon);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
||||
expect(obj.getLayout()).to.eql('XYZ');
|
||||
var rings = obj.getLinearRings();
|
||||
expect(rings.length).to.be(3);
|
||||
expect(rings[0].getCoordinates()[0].length).to.equal(3);
|
||||
@@ -587,7 +587,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Polygon);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYM);
|
||||
expect(obj.getLayout()).to.eql('XYM');
|
||||
var rings = obj.getLinearRings();
|
||||
expect(rings.length).to.be(3);
|
||||
expect(rings[0].getCoordinates()[0].length).to.equal(3);
|
||||
@@ -616,7 +616,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Polygon);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZM);
|
||||
expect(obj.getLayout()).to.eql('XYZM');
|
||||
var rings = obj.getLinearRings();
|
||||
expect(rings.length).to.be(3);
|
||||
expect(rings[0].getCoordinates()[0].length).to.equal(4);
|
||||
@@ -635,7 +635,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.MultiPolygon);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(obj.getLayout()).to.eql('XY');
|
||||
expect(obj.getCoordinates()).to.eql([
|
||||
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2],
|
||||
[3, 3], [2, 3]]],
|
||||
@@ -654,7 +654,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.MultiPolygon);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
||||
expect(obj.getLayout()).to.eql('XYZ');
|
||||
expect(obj.getCoordinates()).to.eql([
|
||||
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
||||
[3, 3, 0], [2, 3, 0]]],
|
||||
@@ -673,7 +673,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.MultiPolygon);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYM);
|
||||
expect(obj.getLayout()).to.eql('XYM');
|
||||
expect(obj.getCoordinates()).to.eql([
|
||||
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
||||
[3, 3, 0], [2, 3, 0]]],
|
||||
@@ -693,7 +693,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.MultiPolygon);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZM);
|
||||
expect(obj.getLayout()).to.eql('XYZM');
|
||||
expect(obj.getCoordinates()).to.eql([
|
||||
[[[0, 1, 0, 1], [1, 4, 0, 1], [4, 3, 0, 1], [3, 0, 0, 1]],
|
||||
[[2, 2, 0, 1], [3, 2, 0, 1],
|
||||
@@ -759,14 +759,14 @@ describe('ol.format.EsriJSON', function() {
|
||||
});
|
||||
|
||||
it('encodes XYZ point', function() {
|
||||
var point = new ol.geom.Point([10, 20, 0], ol.geom.GeometryLayout.XYZ);
|
||||
var point = new ol.geom.Point([10, 20, 0], 'XYZ');
|
||||
var esrijson = format.writeGeometry(point);
|
||||
expect(point.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
});
|
||||
|
||||
it('encodes XYM point', function() {
|
||||
var point = new ol.geom.Point([10, 20, 0], ol.geom.GeometryLayout.XYM);
|
||||
var point = new ol.geom.Point([10, 20, 0], 'XYM');
|
||||
var esrijson = format.writeGeometry(point);
|
||||
expect(point.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -774,7 +774,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
|
||||
it('encodes XYZM point', function() {
|
||||
var point = new ol.geom.Point([10, 20, 5, 0],
|
||||
ol.geom.GeometryLayout.XYZM);
|
||||
'XYZM');
|
||||
var esrijson = format.writeGeometry(point);
|
||||
expect(point.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -789,7 +789,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
|
||||
it('encodes XYZ linestring', function() {
|
||||
var linestring = new ol.geom.LineString([[10, 20, 1534], [30, 40, 1420]],
|
||||
ol.geom.GeometryLayout.XYZ);
|
||||
'XYZ');
|
||||
var esrijson = format.writeGeometry(linestring);
|
||||
expect(linestring.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -797,7 +797,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
|
||||
it('encodes XYM linestring', function() {
|
||||
var linestring = new ol.geom.LineString([[10, 20, 1534], [30, 40, 1420]],
|
||||
ol.geom.GeometryLayout.XYM);
|
||||
'XYM');
|
||||
var esrijson = format.writeGeometry(linestring);
|
||||
expect(linestring.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -806,7 +806,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
it('encodes XYZM linestring', function() {
|
||||
var linestring = new ol.geom.LineString([[10, 20, 1534, 1],
|
||||
[30, 40, 1420, 1]],
|
||||
ol.geom.GeometryLayout.XYZM);
|
||||
'XYZM');
|
||||
var esrijson = format.writeGeometry(linestring);
|
||||
expect(linestring.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -827,7 +827,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]];
|
||||
var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]];
|
||||
var polygon = new ol.geom.Polygon([outer, inner1, inner2],
|
||||
ol.geom.GeometryLayout.XYZ);
|
||||
'XYZ');
|
||||
var esrijson = format.writeGeometry(polygon);
|
||||
expect(polygon.getCoordinates(false)).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -838,7 +838,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var inner1 = [[1, 1, 3], [2, 1, 3], [2, 2, 3], [1, 2, 3], [1, 1, 3]];
|
||||
var inner2 = [[8, 8, 2], [9, 8, 2], [9, 9, 2], [8, 9, 2], [8, 8, 2]];
|
||||
var polygon = new ol.geom.Polygon([outer, inner1, inner2],
|
||||
ol.geom.GeometryLayout.XYM);
|
||||
'XYM');
|
||||
var esrijson = format.writeGeometry(polygon);
|
||||
expect(polygon.getCoordinates(false)).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -855,7 +855,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
[8, 8, 2, 1], [9, 8, 2, 2], [9, 9, 2, 1], [8, 9, 2, 1], [8, 8, 2, 1]
|
||||
];
|
||||
var polygon = new ol.geom.Polygon([outer, inner1, inner2],
|
||||
ol.geom.GeometryLayout.XYZM);
|
||||
'XYZM');
|
||||
var esrijson = format.writeGeometry(polygon);
|
||||
expect(polygon.getCoordinates(false)).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -870,7 +870,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
|
||||
it('encodes XYZ multipoint', function() {
|
||||
var multipoint = new ol.geom.MultiPoint([[102.0, 0.0, 3],
|
||||
[103.0, 1.0, 4]], ol.geom.GeometryLayout.XYZ);
|
||||
[103.0, 1.0, 4]], 'XYZ');
|
||||
var esrijson = format.writeGeometry(multipoint);
|
||||
expect(multipoint.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -878,7 +878,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
|
||||
it('encodes XYM multipoint', function() {
|
||||
var multipoint = new ol.geom.MultiPoint([[102.0, 0.0, 3],
|
||||
[103.0, 1.0, 4]], ol.geom.GeometryLayout.XYM);
|
||||
[103.0, 1.0, 4]], 'XYM');
|
||||
var esrijson = format.writeGeometry(multipoint);
|
||||
expect(multipoint.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -886,7 +886,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
|
||||
it('encodes XYZM multipoint', function() {
|
||||
var multipoint = new ol.geom.MultiPoint([[102.0, 0.0, 3, 1],
|
||||
[103.0, 1.0, 4, 1]], ol.geom.GeometryLayout.XYZM);
|
||||
[103.0, 1.0, 4, 1]], 'XYZM');
|
||||
var esrijson = format.writeGeometry(multipoint);
|
||||
expect(multipoint.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -906,7 +906,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var multilinestring = new ol.geom.MultiLineString([
|
||||
[[102.0, 0.0, 1], [103.0, 1.0, 2], [104.0, 0.0, 3], [105.0, 1.0, 4]],
|
||||
[[105.0, 3.0, 1], [106.0, 4.0, 2], [107.0, 3.0, 3], [108.0, 4.0, 4]]
|
||||
], ol.geom.GeometryLayout.XYZ);
|
||||
], 'XYZ');
|
||||
var esrijson = format.writeGeometry(multilinestring);
|
||||
expect(multilinestring.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -916,7 +916,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
var multilinestring = new ol.geom.MultiLineString([
|
||||
[[102.0, 0.0, 1], [103.0, 1.0, 2], [104.0, 0.0, 3], [105.0, 1.0, 4]],
|
||||
[[105.0, 3.0, 1], [106.0, 4.0, 2], [107.0, 3.0, 3], [108.0, 4.0, 4]]
|
||||
], ol.geom.GeometryLayout.XYM);
|
||||
], 'XYM');
|
||||
var esrijson = format.writeGeometry(multilinestring);
|
||||
expect(multilinestring.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -928,7 +928,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
[105.0, 1.0, 4, 2]],
|
||||
[[105.0, 3.0, 1, 0], [106.0, 4.0, 2, 1], [107.0, 3.0, 3, 1],
|
||||
[108.0, 4.0, 4, 2]]
|
||||
], ol.geom.GeometryLayout.XYZM);
|
||||
], 'XYZM');
|
||||
var esrijson = format.writeGeometry(multilinestring);
|
||||
expect(multilinestring.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -949,7 +949,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
||||
[3, 3, 0], [2, 3, 0]]],
|
||||
[[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]]
|
||||
], ol.geom.GeometryLayout.XYZ);
|
||||
], 'XYZ');
|
||||
var esrijson = format.writeGeometry(multipolygon);
|
||||
expect(multipolygon.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -960,7 +960,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
|
||||
[3, 3, 0], [2, 3, 0]]],
|
||||
[[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]]
|
||||
], ol.geom.GeometryLayout.XYM);
|
||||
], 'XYM');
|
||||
var esrijson = format.writeGeometry(multipolygon);
|
||||
expect(multipolygon.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -972,7 +972,7 @@ describe('ol.format.EsriJSON', function() {
|
||||
[[2, 2, 0, 3], [3, 2, 0, 4],
|
||||
[3, 3, 0, 1], [2, 3, 0, 1]]],
|
||||
[[[10, 1, 0, 1], [11, 5, 0, 2], [14, 3, 0, 3], [13, 0, 0, 3]]]
|
||||
], ol.geom.GeometryLayout.XYZM);
|
||||
], 'XYZM');
|
||||
var esrijson = format.writeGeometry(multipolygon);
|
||||
expect(multipolygon.getCoordinates()).to.eql(
|
||||
format.readGeometry(esrijson).getCoordinates());
|
||||
@@ -1059,7 +1059,6 @@ describe('ol.format.EsriJSON', function() {
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.format.EsriJSON');
|
||||
goog.require('ol.geom.GeometryLayout');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.LinearRing');
|
||||
goog.require('ol.geom.MultiLineString');
|
||||
|
||||
@@ -314,7 +314,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Point);
|
||||
expect(obj.getCoordinates()).to.eql([10, 20]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(obj.getLayout()).to.eql('XY');
|
||||
});
|
||||
|
||||
it('parses linestring', function() {
|
||||
@@ -326,7 +326,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.LineString);
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20], [30, 40]]);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(obj.getLayout()).to.eql('XY');
|
||||
});
|
||||
|
||||
it('parses XYZ linestring', function() {
|
||||
@@ -337,7 +337,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.LineString);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
||||
expect(obj.getLayout()).to.eql('XYZ');
|
||||
expect(obj.getCoordinates()).to.eql([[10, 20, 1534], [30, 40, 1420]]);
|
||||
});
|
||||
|
||||
@@ -352,7 +352,7 @@ describe('ol.format.GeoJSON', function() {
|
||||
|
||||
var obj = format.readGeometry(str);
|
||||
expect(obj).to.be.a(ol.geom.Polygon);
|
||||
expect(obj.getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(obj.getLayout()).to.eql('XY');
|
||||
var rings = obj.getLinearRings();
|
||||
expect(rings.length).to.be(3);
|
||||
expect(rings[0]).to.be.a(ol.geom.LinearRing);
|
||||
@@ -374,9 +374,9 @@ describe('ol.format.GeoJSON', function() {
|
||||
var array = geometryCollection.getGeometries();
|
||||
expect(array.length).to.be(2);
|
||||
expect(array[0]).to.be.a(ol.geom.Point);
|
||||
expect(array[0].getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(array[0].getLayout()).to.eql('XY');
|
||||
expect(array[1]).to.be.a(ol.geom.LineString);
|
||||
expect(array[1].getLayout()).to.eql(ol.geom.GeometryLayout.XY);
|
||||
expect(array[1].getLayout()).to.eql('XY');
|
||||
});
|
||||
|
||||
});
|
||||
@@ -775,7 +775,6 @@ goog.require('ol.Feature');
|
||||
goog.require('ol.extent');
|
||||
goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.geom.Circle');
|
||||
goog.require('ol.geom.GeometryLayout');
|
||||
goog.require('ol.geom.GeometryCollection');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.LinearRing');
|
||||
|
||||
@@ -33,7 +33,7 @@ describe('ol.format.GPX', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.LineString);
|
||||
expect(g.getCoordinates()).to.eql([]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
});
|
||||
|
||||
it('can read and write various rte attributes', function() {
|
||||
@@ -90,7 +90,7 @@ describe('ol.format.GPX', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.LineString);
|
||||
expect(g.getCoordinates()).to.eql([[2, 1, 0, 0], [4, 3, 0, 0]]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs);
|
||||
expect(serialized).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
@@ -119,7 +119,7 @@ describe('ol.format.GPX', function() {
|
||||
var p2 = ol.proj.transform([6, 5], 'EPSG:4326', 'EPSG:3857');
|
||||
p2.push(0, 0);
|
||||
expect(g.getCoordinates()).to.eql([p1, p2]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs, {
|
||||
featureProjection: 'EPSG:3857'
|
||||
});
|
||||
@@ -159,7 +159,7 @@ describe('ol.format.GPX', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.MultiLineString);
|
||||
expect(g.getCoordinates()).to.eql([]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
});
|
||||
|
||||
it('can read and write various trk attributes', function() {
|
||||
@@ -215,7 +215,7 @@ describe('ol.format.GPX', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.MultiLineString);
|
||||
expect(g.getCoordinates()).to.eql([[]]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs);
|
||||
expect(serialized).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
@@ -248,7 +248,7 @@ describe('ol.format.GPX', function() {
|
||||
expect(g.getCoordinates()).to.eql([
|
||||
[[2, 1, 3, 1263115752], [6, 5, 7, 1263115812]]
|
||||
]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs);
|
||||
expect(serialized).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
@@ -285,7 +285,7 @@ describe('ol.format.GPX', function() {
|
||||
var p2 = ol.proj.transform([6, 5], 'EPSG:4326', 'EPSG:3857');
|
||||
p2.push(7, 1263115812);
|
||||
expect(g.getCoordinates()).to.eql([[p1, p2]]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs, {
|
||||
featureProjection: 'EPSG:3857'
|
||||
});
|
||||
@@ -331,7 +331,7 @@ describe('ol.format.GPX', function() {
|
||||
[[2, 1, 3, 1263115752], [6, 5, 7, 1263115812]],
|
||||
[[9, 8, 10, 1263115872], [12, 11, 13, 1263115932]]
|
||||
]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs);
|
||||
expect(serialized).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
@@ -390,7 +390,7 @@ describe('ol.format.GPX', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.Point);
|
||||
expect(g.getCoordinates()).to.eql([2, 1, 0, 0]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs);
|
||||
expect(serialized).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
@@ -414,7 +414,7 @@ describe('ol.format.GPX', function() {
|
||||
var expectedPoint = ol.proj.transform([2, 1], 'EPSG:4326', 'EPSG:3857');
|
||||
expectedPoint.push(0, 0);
|
||||
expect(g.getCoordinates()).to.eql(expectedPoint);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs, {
|
||||
featureProjection: 'EPSG:3857'
|
||||
});
|
||||
@@ -438,7 +438,7 @@ describe('ol.format.GPX', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.Point);
|
||||
expect(g.getCoordinates()).to.eql([2, 1, 3, 0]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs);
|
||||
expect(serialized).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
@@ -460,7 +460,7 @@ describe('ol.format.GPX', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.Point);
|
||||
expect(g.getCoordinates()).to.eql([2, 1, 0, 1263115752]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs);
|
||||
expect(serialized).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
@@ -483,7 +483,7 @@ describe('ol.format.GPX', function() {
|
||||
var g = f.getGeometry();
|
||||
expect(g).to.be.an(ol.geom.Point);
|
||||
expect(g.getCoordinates()).to.eql([2, 1, 3, 1263115752]);
|
||||
expect(g.getLayout()).to.be(ol.geom.GeometryLayout.XYZM);
|
||||
expect(g.getLayout()).to.be('XYZM');
|
||||
var serialized = format.writeFeaturesNode(fs);
|
||||
expect(serialized).to.xmleql(ol.xml.parse(text));
|
||||
});
|
||||
@@ -677,7 +677,6 @@ describe('ol.format.GPX', function() {
|
||||
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.format.GPX');
|
||||
goog.require('ol.geom.GeometryLayout');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.MultiLineString');
|
||||
goog.require('ol.geom.Point');
|
||||
|
||||
@@ -46,7 +46,7 @@ describe('ol.format.IGC', function() {
|
||||
var feature = format.readFeature(igc);
|
||||
expect(feature).to.be.an(ol.Feature);
|
||||
var geom = feature.getGeometry();
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getType()).to.eql('LineString');
|
||||
expect(geom.getCoordinates()).to.eql([
|
||||
[6.851583333333333, 45.9376, 1303202928],
|
||||
[6.850183333333334, 45.93395, 1303203353],
|
||||
@@ -60,7 +60,7 @@ describe('ol.format.IGC', function() {
|
||||
});
|
||||
expect(feature).to.be.an(ol.Feature);
|
||||
var geom = feature.getGeometry();
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getType()).to.eql('LineString');
|
||||
|
||||
var expectedPoint1 = ol.proj.transform(
|
||||
[6.851583333333333, 45.9376], 'EPSG:4326', 'EPSG:3857');
|
||||
@@ -93,7 +93,7 @@ describe('ol.format.IGC', function() {
|
||||
var feature = features[0];
|
||||
expect(feature).to.be.an(ol.Feature);
|
||||
var geom = feature.getGeometry();
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getType()).to.eql('LineString');
|
||||
expect(geom.getCoordinates()).to.eql([
|
||||
[6.851583333333333, 45.9376, 1303202928],
|
||||
[6.850183333333334, 45.93395, 1303203353],
|
||||
@@ -109,7 +109,7 @@ describe('ol.format.IGC', function() {
|
||||
var feature = features[0];
|
||||
expect(feature).to.be.an(ol.Feature);
|
||||
var geom = feature.getGeometry();
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getType()).to.eql('LineString');
|
||||
|
||||
var expectedPoint1 = ol.proj.transform(
|
||||
[6.851583333333333, 45.9376], 'EPSG:4326', 'EPSG:3857');
|
||||
@@ -133,5 +133,4 @@ describe('ol.format.IGC', function() {
|
||||
|
||||
goog.require('ol.format.IGC');
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.geom.GeometryType');
|
||||
goog.require('ol.proj');
|
||||
|
||||
@@ -220,7 +220,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XY Point geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XY;
|
||||
var layout = 'XY';
|
||||
var point = new ol.geom.Point([1, 2], layout);
|
||||
var features = [new ol.Feature(point)];
|
||||
var node = format.writeFeaturesNode(features);
|
||||
@@ -240,7 +240,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYZ Point geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZ;
|
||||
var layout = 'XYZ';
|
||||
var point = new ol.geom.Point([1, 2, 3], layout);
|
||||
var features = [new ol.Feature(point)];
|
||||
var node = format.writeFeaturesNode(features);
|
||||
@@ -269,7 +269,7 @@ describe('ol.format.KML', function() {
|
||||
return [coordinate[0] / 2, coordinate[1] / 2];
|
||||
});
|
||||
|
||||
var layout = ol.geom.GeometryLayout.XYZ;
|
||||
var layout = 'XYZ';
|
||||
var point = new ol.geom.Point([1, 2, 3], layout).transform(
|
||||
'EPSG:4326', 'double');
|
||||
var features = [new ol.Feature(point)];
|
||||
@@ -297,7 +297,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYM Point geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYM;
|
||||
var layout = 'XYM';
|
||||
var point = new ol.geom.Point([1, 2, 100], layout);
|
||||
var features = [new ol.Feature(point)];
|
||||
var node = format.writeFeaturesNode(features);
|
||||
@@ -317,7 +317,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYZM Point geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZM;
|
||||
var layout = 'XYZM';
|
||||
var point = new ol.geom.Point([1, 2, 3, 100], layout);
|
||||
var features = [new ol.Feature(point)];
|
||||
var node = format.writeFeaturesNode(features);
|
||||
@@ -359,7 +359,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XY LineString geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XY;
|
||||
var layout = 'XY';
|
||||
var lineString = new ol.geom.LineString([[1, 2], [3, 4]], layout);
|
||||
var features = [new ol.Feature(lineString)];
|
||||
var node = format.writeFeaturesNode(features);
|
||||
@@ -379,7 +379,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYZ LineString geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZ;
|
||||
var layout = 'XYZ';
|
||||
var lineString = new ol.geom.LineString(
|
||||
[[1, 2, 3], [4, 5, 6]], layout);
|
||||
var features = [new ol.Feature(lineString)];
|
||||
@@ -400,7 +400,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYM LineString geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYM;
|
||||
var layout = 'XYM';
|
||||
var lineString = new ol.geom.LineString(
|
||||
[[1, 2, 100], [3, 4, 200]], layout);
|
||||
var features = [new ol.Feature(lineString)];
|
||||
@@ -421,7 +421,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYZM LineString geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZM;
|
||||
var layout = 'XYZM';
|
||||
var lineString = new ol.geom.LineString(
|
||||
[[1, 2, 3, 100], [4, 5, 6, 200]], layout);
|
||||
var features = [new ol.Feature(lineString)];
|
||||
@@ -460,7 +460,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XY LinearRing geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XY;
|
||||
var layout = 'XY';
|
||||
var linearRing = new ol.geom.LinearRing(
|
||||
[[1, 2], [3, 4], [1, 2]], layout);
|
||||
var features = [new ol.Feature(linearRing)];
|
||||
@@ -481,7 +481,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYZ LinearRing geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZ;
|
||||
var layout = 'XYZ';
|
||||
var linearRing = new ol.geom.LinearRing(
|
||||
[[1, 2, 3], [4, 5, 6], [1, 2, 3]], layout);
|
||||
var features = [new ol.Feature(linearRing)];
|
||||
@@ -502,7 +502,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYM LinearRing geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYM;
|
||||
var layout = 'XYM';
|
||||
var linearRing = new ol.geom.LinearRing(
|
||||
[[1, 2, 100], [3, 4, 200], [1, 2, 100]], layout);
|
||||
var features = [new ol.Feature(linearRing)];
|
||||
@@ -523,7 +523,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYZM LinearRing geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZM;
|
||||
var layout = 'XYZM';
|
||||
var linearRing = new ol.geom.LinearRing(
|
||||
[[1, 2, 3, 100], [4, 5, 6, 200], [1, 2, 3, 100]], layout);
|
||||
var features = [new ol.Feature(linearRing)];
|
||||
@@ -571,7 +571,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XY Polygon geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XY;
|
||||
var layout = 'XY';
|
||||
var polygon = new ol.geom.Polygon(
|
||||
[[[0, 0], [0, 2], [2, 2], [2, 0], [0, 0]]], layout);
|
||||
var features = [new ol.Feature(polygon)];
|
||||
@@ -596,7 +596,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYZ Polygon geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZ;
|
||||
var layout = 'XYZ';
|
||||
var polygon = new ol.geom.Polygon(
|
||||
[[[0, 0, 1], [0, 2, 2], [2, 2, 3], [2, 0, 4], [0, 0, 5]]], layout);
|
||||
var features = [new ol.Feature(polygon)];
|
||||
@@ -623,7 +623,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYM Polygon geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYM;
|
||||
var layout = 'XYM';
|
||||
var polygon = new ol.geom.Polygon(
|
||||
[[[0, 0, 1], [0, 2, 1], [2, 2, 1], [2, 0, 1], [0, 0, 1]]], layout);
|
||||
var features = [new ol.Feature(polygon)];
|
||||
@@ -650,7 +650,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write XYZM Polygon geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZM;
|
||||
var layout = 'XYZM';
|
||||
var polygon = new ol.geom.Polygon(
|
||||
[[[0, 0, 1, 1], [0, 2, 2, 1], [2, 2, 3, 1],
|
||||
[2, 0, 4, 1], [0, 0, 5, 1]]], layout);
|
||||
@@ -711,7 +711,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write complex Polygon geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZ;
|
||||
var layout = 'XYZ';
|
||||
var polygon = new ol.geom.Polygon(
|
||||
[[[0, 0, 1], [0, 5, 1], [5, 5, 2], [5, 0, 3]],
|
||||
[[1, 1, 0], [1, 2, 0], [2, 2, 0], [2, 1, 0]],
|
||||
@@ -783,7 +783,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write MultiPoint geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZ;
|
||||
var layout = 'XYZ';
|
||||
var multiPoint = new ol.geom.MultiPoint(
|
||||
[[1, 2, 3], [4, 5, 6]], layout);
|
||||
var features = [new ol.Feature(multiPoint)];
|
||||
@@ -843,7 +843,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write MultiLineString geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZ;
|
||||
var layout = 'XYZ';
|
||||
var multiLineString = new ol.geom.MultiLineString(
|
||||
[[[1, 2, 3], [4, 5, 6]], [[7, 8, 9], [10, 11, 12]]], layout);
|
||||
var features = [new ol.Feature(multiLineString)];
|
||||
@@ -912,7 +912,7 @@ describe('ol.format.KML', function() {
|
||||
});
|
||||
|
||||
it('can write MultiPolygon geometries', function() {
|
||||
var layout = ol.geom.GeometryLayout.XYZ;
|
||||
var layout = 'XYZ';
|
||||
var multiPolygon = new ol.geom.MultiPolygon(
|
||||
[[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
|
||||
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]], layout);
|
||||
@@ -1772,12 +1772,12 @@ describe('ol.format.KML', function() {
|
||||
var style = new ol.style.Style({
|
||||
image: new ol.style.Icon({
|
||||
anchor: [0.25, 36],
|
||||
anchorOrigin: ol.style.IconOrigin.TOP_LEFT,
|
||||
anchorOrigin: 'top-left',
|
||||
anchorXUnits: 'fraction',
|
||||
anchorYUnits: 'pixels',
|
||||
crossOrigin: 'anonymous',
|
||||
offset: [96, 96],
|
||||
offsetOrigin: ol.style.IconOrigin.TOP_LEFT,
|
||||
offsetOrigin: 'top-left',
|
||||
rotation: 45,
|
||||
scale: 0.5,
|
||||
size: [48, 48],
|
||||
@@ -2874,7 +2874,6 @@ goog.require('ol.Feature');
|
||||
goog.require('ol.format.GeoJSON');
|
||||
goog.require('ol.format.KML');
|
||||
goog.require('ol.geom.GeometryCollection');
|
||||
goog.require('ol.geom.GeometryLayout');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.geom.LinearRing');
|
||||
goog.require('ol.geom.MultiLineString');
|
||||
@@ -2885,7 +2884,6 @@ goog.require('ol.geom.Polygon');
|
||||
goog.require('ol.style.Circle');
|
||||
goog.require('ol.style.Fill');
|
||||
goog.require('ol.style.Icon');
|
||||
goog.require('ol.style.IconOrigin');
|
||||
goog.require('ol.proj');
|
||||
goog.require('ol.proj.Projection');
|
||||
goog.require('ol.style.Stroke');
|
||||
|
||||
@@ -316,11 +316,11 @@ describe('ol.format.Polyline', function() {
|
||||
43.252, -126.453, 20
|
||||
], 3);
|
||||
var format = new ol.format.Polyline({
|
||||
geometryLayout: ol.geom.GeometryLayout.XYZ
|
||||
geometryLayout: 'XYZ'
|
||||
});
|
||||
|
||||
var geometry = format.readGeometry(xyz);
|
||||
expect(geometry.getLayout()).to.eql(ol.geom.GeometryLayout.XYZ);
|
||||
expect(geometry.getLayout()).to.eql('XYZ');
|
||||
expect(geometry.getCoordinates()).to.eql([
|
||||
[-120.200, 38.500, 100],
|
||||
[-120.950, 40.700, 200],
|
||||
@@ -399,6 +399,5 @@ describe('ol.format.Polyline', function() {
|
||||
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.format.Polyline');
|
||||
goog.require('ol.geom.GeometryLayout');
|
||||
goog.require('ol.geom.LineString');
|
||||
goog.require('ol.proj');
|
||||
|
||||
@@ -84,8 +84,8 @@ describe('ol.format.WKT', function() {
|
||||
expect(features.length).to.eql(2);
|
||||
var point1 = features[0].getGeometry();
|
||||
var point2 = features[1].getGeometry();
|
||||
expect(point1.getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(point2.getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(point1.getType()).to.eql('Point');
|
||||
expect(point2.getType()).to.eql('Point');
|
||||
expect(point1.getCoordinates()).to.eql(
|
||||
ol.proj.transform([1, 2], 'EPSG:4326', 'EPSG:3857'));
|
||||
expect(point2.getCoordinates()).to.eql(
|
||||
@@ -157,13 +157,13 @@ describe('ol.format.WKT', function() {
|
||||
it('LineString read / written correctly', function() {
|
||||
var wkt = 'LINESTRING(30 10,10 30,40 40)';
|
||||
var geom = format.readGeometry(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getType()).to.eql('LineString');
|
||||
expect(geom.getCoordinates()).to.eql([[30, 10], [10, 30], [40, 40]]);
|
||||
expect(format.writeGeometry(geom)).to.eql(wkt);
|
||||
// test whitespace when reading
|
||||
wkt = 'LINESTRING (30 10, 10 30, 40 40)';
|
||||
geom = format.readGeometry(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getType()).to.eql('LineString');
|
||||
expect(geom.getCoordinates()).to.eql([[30, 10], [10, 30], [40, 40]]);
|
||||
});
|
||||
|
||||
@@ -171,10 +171,10 @@ describe('ol.format.WKT', function() {
|
||||
var wkt = 'MULTILINESTRING((10 10,20 20,10 40),' +
|
||||
'(40 40,30 30,40 20,30 10))';
|
||||
var geom = format.readGeometry(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_LINE_STRING);
|
||||
expect(geom.getType()).to.eql('MultiLineString');
|
||||
var linestrings = geom.getLineStrings();
|
||||
expect(linestrings.length).to.eql(2);
|
||||
expect(linestrings[0].getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(linestrings[0].getType()).to.eql('LineString');
|
||||
expect(linestrings[0].getCoordinates()).to.eql(
|
||||
[[10, 10], [20, 20], [10, 40]]);
|
||||
expect(format.writeGeometry(geom)).to.eql(wkt);
|
||||
@@ -182,11 +182,11 @@ describe('ol.format.WKT', function() {
|
||||
wkt = 'MULTILINESTRING ( (10 10, 20 20, 10 40), ' +
|
||||
'(40 40, 30 30, 40 20, 30 10) )';
|
||||
geom = format.readGeometry(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_LINE_STRING);
|
||||
expect(geom.getType()).to.eql('MultiLineString');
|
||||
linestrings = geom.getLineStrings();
|
||||
expect(linestrings.length).to.eql(2);
|
||||
expect(linestrings[0].getType()).to.eql(
|
||||
ol.geom.GeometryType.LINE_STRING);
|
||||
'LineString');
|
||||
expect(linestrings[0].getCoordinates()).to.eql(
|
||||
[[10, 10], [20, 20], [10, 40]]);
|
||||
});
|
||||
@@ -194,10 +194,10 @@ describe('ol.format.WKT', function() {
|
||||
it('Polygon read / written correctly', function() {
|
||||
var wkt = 'POLYGON((30 10,10 20,20 40,40 40,30 10))';
|
||||
var geom = format.readGeometry(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
expect(geom.getType()).to.eql('Polygon');
|
||||
var rings = geom.getLinearRings();
|
||||
expect(rings.length).to.eql(1);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[0].getType()).to.eql('LinearRing');
|
||||
expect(rings[0].getCoordinates()).to.eql(
|
||||
[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]);
|
||||
expect(format.writeGeometry(geom)).to.eql(wkt);
|
||||
@@ -205,11 +205,11 @@ describe('ol.format.WKT', function() {
|
||||
// note that WKT doesn't care about winding order, we do
|
||||
wkt = 'POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,30 20,35 35,20 30))';
|
||||
geom = format.readGeometry(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
expect(geom.getType()).to.eql('Polygon');
|
||||
rings = geom.getLinearRings();
|
||||
expect(rings.length).to.eql(2);
|
||||
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].getType()).to.eql('LinearRing');
|
||||
expect(rings[1].getType()).to.eql('LinearRing');
|
||||
expect(rings[0].getCoordinates()).to.eql(
|
||||
[[35, 10], [10, 20], [15, 40], [45, 45], [35, 10]]);
|
||||
expect(rings[1].getCoordinates()).to.eql(
|
||||
@@ -219,10 +219,10 @@ describe('ol.format.WKT', function() {
|
||||
// test whitespace when reading
|
||||
wkt = 'POLYGON ( (30 10, 10 20, 20 40, 40 40, 30 10) )';
|
||||
geom = format.readGeometry(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
expect(geom.getType()).to.eql('Polygon');
|
||||
rings = geom.getLinearRings();
|
||||
expect(rings.length).to.eql(1);
|
||||
expect(rings[0].getType()).to.eql(ol.geom.GeometryType.LINEAR_RING);
|
||||
expect(rings[0].getType()).to.eql('LinearRing');
|
||||
expect(rings[0].getCoordinates()).to.eql(
|
||||
[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]);
|
||||
});
|
||||
@@ -232,11 +232,11 @@ describe('ol.format.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 = format.readGeometry(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_POLYGON);
|
||||
expect(geom.getType()).to.eql('MultiPolygon');
|
||||
var polygons = geom.getPolygons();
|
||||
expect(polygons.length).to.eql(2);
|
||||
expect(polygons[0].getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
expect(polygons[1].getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
expect(polygons[0].getType()).to.eql('Polygon');
|
||||
expect(polygons[1].getType()).to.eql('Polygon');
|
||||
expect(polygons[0].getLinearRings().length).to.eql(1);
|
||||
expect(polygons[1].getLinearRings().length).to.eql(2);
|
||||
expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql(
|
||||
@@ -252,11 +252,11 @@ describe('ol.format.WKT', function() {
|
||||
'( (20 35, 45 20,30 5,10 10,10 30,20 35), ' +
|
||||
'( 30 20, 20 25,20 15 ,30 20 ) ))';
|
||||
geom = format.readGeometry(wkt);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.MULTI_POLYGON);
|
||||
expect(geom.getType()).to.eql('MultiPolygon');
|
||||
polygons = geom.getPolygons();
|
||||
expect(polygons.length).to.eql(2);
|
||||
expect(polygons[0].getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
expect(polygons[1].getType()).to.eql(ol.geom.GeometryType.POLYGON);
|
||||
expect(polygons[0].getType()).to.eql('Polygon');
|
||||
expect(polygons[1].getType()).to.eql('Polygon');
|
||||
expect(polygons[0].getLinearRings().length).to.eql(1);
|
||||
expect(polygons[1].getLinearRings().length).to.eql(2);
|
||||
expect(polygons[0].getLinearRings()[0].getCoordinates()).to.eql(
|
||||
@@ -310,9 +310,9 @@ describe('ol.format.WKT', function() {
|
||||
var geom = format.readGeometry(wkt);
|
||||
var geoms = geom.getGeometries();
|
||||
expect(geoms.length).to.eql(2);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRY_COLLECTION);
|
||||
expect(geoms[0].getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(geoms[1].getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getType()).to.eql('GeometryCollection');
|
||||
expect(geoms[0].getType()).to.eql('Point');
|
||||
expect(geoms[1].getType()).to.eql('LineString');
|
||||
expect(geoms[0].getCoordinates()).to.eql([4, 6]);
|
||||
expect(geoms[1].getCoordinates()).to.eql([[4, 6], [7, 10]]);
|
||||
expect(format.writeGeometry(geom)).to.eql(wkt);
|
||||
@@ -321,9 +321,9 @@ describe('ol.format.WKT', function() {
|
||||
geom = format.readGeometry(wkt);
|
||||
geoms = geom.getGeometries();
|
||||
expect(geoms.length).to.eql(2);
|
||||
expect(geom.getType()).to.eql(ol.geom.GeometryType.GEOMETRY_COLLECTION);
|
||||
expect(geoms[0].getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(geoms[1].getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geom.getType()).to.eql('GeometryCollection');
|
||||
expect(geoms[0].getType()).to.eql('Point');
|
||||
expect(geoms[1].getType()).to.eql('LineString');
|
||||
expect(geoms[0].getCoordinates()).to.eql([4, 6]);
|
||||
expect(geoms[1].getCoordinates()).to.eql([[4, 6], [7, 10]]);
|
||||
});
|
||||
@@ -341,8 +341,8 @@ describe('ol.format.WKT', function() {
|
||||
var features = format.readFeatures(wkt);
|
||||
expect(features.length).to.eql(2);
|
||||
var geoms = [features[0].getGeometry(), features[1].getGeometry()];
|
||||
expect(geoms[0].getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(geoms[1].getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
|
||||
expect(geoms[0].getType()).to.eql('Point');
|
||||
expect(geoms[1].getType()).to.eql('LineString');
|
||||
expect(geoms[0].getCoordinates()).to.eql([4, 6]);
|
||||
expect(geoms[1].getCoordinates()).to.eql([[4, 6], [7, 10]]);
|
||||
expect(format.writeFeatures(features)).to.eql(wkt);
|
||||
@@ -362,8 +362,8 @@ describe('ol.format.WKT', function() {
|
||||
expect(features.length).to.eql(2);
|
||||
var point1 = features[0].getGeometry();
|
||||
var point2 = features[1].getGeometry();
|
||||
expect(point1.getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(point2.getType()).to.eql(ol.geom.GeometryType.POINT);
|
||||
expect(point1.getType()).to.eql('Point');
|
||||
expect(point2.getType()).to.eql('Point');
|
||||
expect(point1.getCoordinates()).to.eql([1, 2]);
|
||||
expect(point2.getCoordinates()).to.eql([3, 4]);
|
||||
expect(format.writeFeatures(features)).to.eql(wkt);
|
||||
@@ -429,7 +429,6 @@ describe('ol.format.WKT', function() {
|
||||
});
|
||||
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.geom.GeometryType');
|
||||
goog.require('ol.geom.Point');
|
||||
goog.require('ol.format.WKT');
|
||||
goog.require('ol.proj');
|
||||
|
||||
Reference in New Issue
Block a user