Add EPSG:4326 tests

This commit is contained in:
Tom Payne
2014-03-18 16:23:28 +01:00
parent b3ac959d6a
commit f41a4dc543

View File

@@ -33,6 +33,19 @@ describe('ol.format.GML', function() {
expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text));
});
it('can read and write a point geometry in EPSG:4326', function() {
var text =
'<gml:Point xmlns:gml="http://www.opengis.net/gml" ' +
' srsName="urn:x-ogc:def:crs:EPSG:4326">' +
' <gml:pos>2 1</gml:pos>' +
'</gml:Point>';
var g = readGeometry(formatWGS84, text);
expect(g).to.be.an(ol.geom.Point);
expect(g.getCoordinates()).to.eql([1, 2, 0]);
var serialized = formatWGS84.writeGeometry(g);
expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text));
});
});
describe('linestring', function() {
@@ -50,6 +63,19 @@ describe('ol.format.GML', function() {
expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text));
});
it('can read and write a linestring geometry in EPSG:4326', function() {
var text =
'<gml:LineString xmlns:gml="http://www.opengis.net/gml" ' +
' srsName="urn:x-ogc:def:crs:EPSG:4326">' +
' <gml:posList>2 1 4 3</gml:posList>' +
'</gml:LineString>';
var g = readGeometry(formatWGS84, text);
expect(g).to.be.an(ol.geom.LineString);
expect(g.getCoordinates()).to.eql([[1, 2, 0], [3, 4, 0]]);
var serialized = formatWGS84.writeGeometry(g);
expect(serialized.firstElementChild).to.xmleql(ol.xml.load(text));
});
});
describe('axis order', function() {