Merge pull request #1335 from tschaub/geometry-type

Change geometry type enum and mark as stable.
This commit is contained in:
Tim Schaub
2013-12-10 08:50:54 -08:00
30 changed files with 176 additions and 176 deletions

View File

@@ -792,10 +792,10 @@ describe('ol.expr.lib', function() {
]])
});
var isPoint = parse('geometryType("point")');
var isLine = parse('geometryType("linestring")');
var isPoly = parse('geometryType("polygon")');
var pointOrPoly = parse('geometryType("point") || geometryType("polygon")');
var isPoint = parse('geometryType("Point")');
var isLine = parse('geometryType("LineString")');
var isPoly = parse('geometryType("Polygon")');
var pointOrPoly = parse('geometryType("Point") || geometryType("Polygon")');
it('distinguishes point features', function() {
expect(evaluate(isPoint, point)).to.be(true);

View File

@@ -104,7 +104,7 @@ describe('ol.interaction.Draw', function() {
beforeEach(function() {
map.addInteraction(new ol.interaction.Draw({
layer: layer,
type: ol.geom.GeometryType.MULTIPOINT
type: ol.geom.GeometryType.MULTI_POINT
}));
});
@@ -127,7 +127,7 @@ describe('ol.interaction.Draw', function() {
beforeEach(function() {
map.addInteraction(new ol.interaction.Draw({
layer: layer,
type: ol.geom.GeometryType.LINESTRING
type: ol.geom.GeometryType.LINE_STRING
}));
});
@@ -196,7 +196,7 @@ describe('ol.interaction.Draw', function() {
beforeEach(function() {
map.addInteraction(new ol.interaction.Draw({
layer: layer,
type: ol.geom.GeometryType.MULTILINESTRING
type: ol.geom.GeometryType.MULTI_LINE_STRING
}));
});
@@ -279,7 +279,7 @@ describe('ol.interaction.Draw', function() {
beforeEach(function() {
map.addInteraction(new ol.interaction.Draw({
layer: layer,
type: ol.geom.GeometryType.MULTIPOLYGON
type: ol.geom.GeometryType.MULTI_POLYGON
}));
});

View File

@@ -19,7 +19,7 @@ describe('ol.parser.gpx', function() {
feature = obj.features[1];
geom = feature.getGeometry();
var attributes = feature.getAttributes();
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINESTRING);
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
expect(geom.getCoordinates()).to.eql([[-0.1829991904, 51.3761803674],
[-0.1758887005, 51.3697894659], [-0.1833202965, 51.3639790884],
[-0.1751119509, 51.3567607069]]);
@@ -29,7 +29,7 @@ describe('ol.parser.gpx', function() {
feature = obj.features[2];
geom = feature.getGeometry();
attributes = feature.getAttributes();
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINESTRING);
expect(geom.getType()).to.eql(ol.geom.GeometryType.LINE_STRING);
expect(geom.getCoordinates()).to.eql([[-0.1721292044, 51.3768216433],
[-0.1649230916, 51.370833767], [-0.1736741378, 51.3644368725],
[-0.166259525, 51.3576354272]]);

View File

@@ -198,7 +198,7 @@ describe('ol.parser.KML', function() {
var stroke = symbolizers[0];
expect(stroke).to.be.a(ol.style.Stroke);
var literal = stroke.createLiteral(ol.geom.GeometryType.LINESTRING);
var literal = stroke.createLiteral(ol.geom.GeometryType.LINE_STRING);
expect(literal).to.be.a(ol.style.LineLiteral);
expect(literal.color).to.eql('#ff0000');
expect(literal.opacity).to.eql(0.5294117647058824);

View File

@@ -9,7 +9,7 @@ describe('ol.parser.gml_v2', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v2/point-coord.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('point');
expect(obj.geometry.type).to.eql('Point');
expect(obj.geometry.coordinates).to.eql([1, 2]);
done();
});
@@ -25,7 +25,7 @@ describe('ol.parser.gml_v2', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('point');
expect(obj.geometry.type).to.eql('Point');
expect(obj.geometry.coordinates).to.eql([1, 2]);
done();
});
@@ -34,9 +34,9 @@ describe('ol.parser.gml_v2', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v2/multipoint-coord.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('multipoint');
expect(obj.geometry.type).to.eql('MultiPoint');
expect(obj.geometry.parts.length).to.eql(3);
expect(obj.geometry.parts[0].type).to.eql('point');
expect(obj.geometry.parts[0].type).to.eql('Point');
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
expect(obj.geometry.parts[1].coordinates).to.eql([2, 3]);
expect(obj.geometry.parts[2].coordinates).to.eql([3, 4]);
@@ -54,9 +54,9 @@ describe('ol.parser.gml_v2', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multipoint');
expect(obj.geometry.type).to.eql('MultiPoint');
expect(obj.geometry.parts.length).to.eql(3);
expect(obj.geometry.parts[0].type).to.eql('point');
expect(obj.geometry.parts[0].type).to.eql('Point');
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
expect(obj.geometry.parts[1].coordinates).to.eql([2, 3]);
expect(obj.geometry.parts[2].coordinates).to.eql([3, 4]);
@@ -67,7 +67,7 @@ describe('ol.parser.gml_v2', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v2/linestring-coord.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('linestring');
expect(obj.geometry.type).to.eql('LineString');
expect(obj.geometry.coordinates.length).to.eql(2);
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
done();
@@ -84,7 +84,7 @@ describe('ol.parser.gml_v2', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('linestring');
expect(obj.geometry.type).to.eql('LineString');
expect(obj.geometry.coordinates.length).to.eql(2);
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
done();
@@ -94,9 +94,9 @@ describe('ol.parser.gml_v2', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v2/multilinestring-coord.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('multilinestring');
expect(obj.geometry.type).to.eql('MultiLineString');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('linestring');
expect(obj.geometry.parts[0].type).to.eql('LineString');
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
expect(obj.geometry.parts[1].coordinates).to.eql([[3, 4], [4, 5]]);
done();
@@ -113,9 +113,9 @@ describe('ol.parser.gml_v2', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multilinestring');
expect(obj.geometry.type).to.eql('MultiLineString');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('linestring');
expect(obj.geometry.parts[0].type).to.eql('LineString');
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
expect(obj.geometry.parts[1].coordinates).to.eql([[3, 4], [4, 5]]);
done();
@@ -125,7 +125,7 @@ describe('ol.parser.gml_v2', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v2/polygon-coord.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('polygon');
expect(obj.geometry.type).to.eql('Polygon');
expect(obj.geometry.coordinates.length).to.eql(3);
expect(obj.geometry.coordinates[0].length).to.eql(4);
expect(obj.geometry.coordinates[0]).to.eql([[1, 2], [3, 4],
@@ -148,7 +148,7 @@ describe('ol.parser.gml_v2', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('polygon');
expect(obj.geometry.type).to.eql('Polygon');
done();
});
});
@@ -156,9 +156,9 @@ describe('ol.parser.gml_v2', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v2/multipolygon-coord.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('multipolygon');
expect(obj.geometry.type).to.eql('MultiPolygon');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('polygon');
expect(obj.geometry.parts[0].type).to.eql('Polygon');
done();
});
});
@@ -173,9 +173,9 @@ describe('ol.parser.gml_v2', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multipolygon');
expect(obj.geometry.type).to.eql('MultiPolygon');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('polygon');
expect(obj.geometry.parts[0].type).to.eql('Polygon');
done();
});
});
@@ -192,11 +192,11 @@ describe('ol.parser.gml_v2', function() {
delete p.srsName;
delete p.axisOrientation;
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('geometrycollection');
expect(obj.geometry.type).to.eql('GeometryCollection');
expect(obj.geometry.parts.length).to.eql(3);
expect(obj.geometry.parts[0].type).to.eql('point');
expect(obj.geometry.parts[1].type).to.eql('linestring');
expect(obj.geometry.parts[2].type).to.eql('polygon');
expect(obj.geometry.parts[0].type).to.eql('Point');
expect(obj.geometry.parts[1].type).to.eql('LineString');
expect(obj.geometry.parts[2].type).to.eql('Polygon');
done();
});
});
@@ -220,7 +220,7 @@ describe('ol.parser.gml_v2', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v2/linearring-coord.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('linearring');
expect(obj.geometry.type).to.eql('LinearRing');
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4], [5, 6],
[1, 2]]);
done();
@@ -237,7 +237,7 @@ describe('ol.parser.gml_v2', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('linearring');
expect(obj.geometry.type).to.eql('LinearRing');
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4], [5, 6],
[1, 2]]);
done();

View File

@@ -24,7 +24,7 @@ describe('ol.parser.gml_v3', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('linearring');
expect(obj.geometry.type).to.eql('LinearRing');
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4], [5, 6],
[1, 2]]);
done();
@@ -41,7 +41,7 @@ describe('ol.parser.gml_v3', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('linestring');
expect(obj.geometry.type).to.eql('LineString');
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
done();
});
@@ -51,7 +51,7 @@ describe('ol.parser.gml_v3', function() {
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
// no write test since simple features only does 2D
expect(obj.geometry.type).to.eql('linestring');
expect(obj.geometry.type).to.eql('LineString');
expect(obj.geometry.coordinates).to.eql([[1, 2, 3], [4, 5, 6]]);
done();
});
@@ -68,7 +68,7 @@ describe('ol.parser.gml_v3', function() {
delete p.srsName;
delete p.axisOrientation;
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('linestring');
expect(obj.geometry.type).to.eql('LineString');
expect(obj.geometry.coordinates).to.eql([[1, 2], [3, 4]]);
done();
});
@@ -78,9 +78,9 @@ describe('ol.parser.gml_v3', function() {
afterLoadXml(url, function(xml) {
// no write test for plural, we only write singular
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('multilinestring');
expect(obj.geometry.type).to.eql('MultiLineString');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('linestring');
expect(obj.geometry.parts[0].type).to.eql('LineString');
done();
});
});
@@ -96,9 +96,9 @@ describe('ol.parser.gml_v3', function() {
delete p.srsName;
delete p.axisOrientation;
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multilinestring');
expect(obj.geometry.type).to.eql('MultiLineString');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('linestring');
expect(obj.geometry.parts[0].type).to.eql('LineString');
done();
});
});
@@ -113,9 +113,9 @@ describe('ol.parser.gml_v3', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multilinestring');
expect(obj.geometry.type).to.eql('MultiLineString');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('linestring');
expect(obj.geometry.parts[0].type).to.eql('LineString');
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
done();
});
@@ -132,9 +132,9 @@ describe('ol.parser.gml_v3', function() {
delete p.srsName;
delete p.axisOrientation;
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multilinestring');
expect(obj.geometry.type).to.eql('MultiLineString');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('linestring');
expect(obj.geometry.parts[0].type).to.eql('LineString');
expect(obj.geometry.parts[0].coordinates).to.eql([[1, 2], [2, 3]]);
done();
});
@@ -143,9 +143,9 @@ describe('ol.parser.gml_v3', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v3/multipoint-plural.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('multipoint');
expect(obj.geometry.type).to.eql('MultiPoint');
expect(obj.geometry.parts.length).to.eql(3);
expect(obj.geometry.parts[0].type).to.eql('point');
expect(obj.geometry.parts[0].type).to.eql('Point');
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
done();
});
@@ -161,9 +161,9 @@ describe('ol.parser.gml_v3', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multipoint');
expect(obj.geometry.type).to.eql('MultiPoint');
expect(obj.geometry.parts.length).to.eql(3);
expect(obj.geometry.parts[0].type).to.eql('point');
expect(obj.geometry.parts[0].type).to.eql('Point');
expect(obj.geometry.parts[0].coordinates).to.eql([1, 2]);
done();
});
@@ -172,9 +172,9 @@ describe('ol.parser.gml_v3', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v3/multipolygon-plural.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('multipolygon');
expect(obj.geometry.type).to.eql('MultiPolygon');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('polygon');
expect(obj.geometry.parts[0].type).to.eql('Polygon');
done();
});
});
@@ -190,9 +190,9 @@ describe('ol.parser.gml_v3', function() {
delete p.srsName;
delete p.axisOrientation;
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multipolygon');
expect(obj.geometry.type).to.eql('MultiPolygon');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('polygon');
expect(obj.geometry.parts[0].type).to.eql('Polygon');
done();
});
});
@@ -200,9 +200,9 @@ describe('ol.parser.gml_v3', function() {
var url = 'spec/ol/parser/ogc/xml/gml_v3/multisurface-plural.xml';
afterLoadXml(url, function(xml) {
var obj = parser.read(xml);
expect(obj.geometry.type).to.eql('multipolygon');
expect(obj.geometry.type).to.eql('MultiPolygon');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('polygon');
expect(obj.geometry.parts[0].type).to.eql('Polygon');
done();
});
});
@@ -217,9 +217,9 @@ describe('ol.parser.gml_v3', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multipolygon');
expect(obj.geometry.type).to.eql('MultiPolygon');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('polygon');
expect(obj.geometry.parts[0].type).to.eql('Polygon');
done();
});
});
@@ -235,9 +235,9 @@ describe('ol.parser.gml_v3', function() {
delete p.srsName;
delete p.axisOrientation;
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('multipolygon');
expect(obj.geometry.type).to.eql('MultiPolygon');
expect(obj.geometry.parts.length).to.eql(2);
expect(obj.geometry.parts[0].type).to.eql('polygon');
expect(obj.geometry.parts[0].type).to.eql('Polygon');
done();
});
});
@@ -252,7 +252,7 @@ describe('ol.parser.gml_v3', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('point');
expect(obj.geometry.type).to.eql('Point');
expect(obj.geometry.coordinates).to.eql([1, 2]);
done();
});
@@ -268,7 +268,7 @@ describe('ol.parser.gml_v3', function() {
delete parser.srsName;
delete parser.axisOrientation;
expect(goog.dom.xml.loadXml(parser.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('polygon');
expect(obj.geometry.type).to.eql('Polygon');
done();
});
});
@@ -284,7 +284,7 @@ describe('ol.parser.gml_v3', function() {
delete p.srsName;
delete p.axisOrientation;
expect(goog.dom.xml.loadXml(p.serialize(node))).to.xmleql(xml);
expect(obj.geometry.type).to.eql('polygon');
expect(obj.geometry.type).to.eql('Polygon');
done();
});
});

View File

@@ -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]]);
});

View File

@@ -55,7 +55,7 @@ describe('ol.style.Stroke', function() {
it('applies the default values', function() {
var symbolizer = new ol.style.Stroke({});
var literal = symbolizer.createLiteral(ol.geom.GeometryType.LINESTRING);
var literal = symbolizer.createLiteral(ol.geom.GeometryType.LINE_STRING);
expect(literal).to.be.a(ol.style.LineLiteral);
expect(literal.color).to.be('#696969');
expect(literal.opacity).to.be(0.75);