Add tests for gml2 gml:box element

This commit is contained in:
Florent gravin
2014-10-03 12:02:14 +02:00
parent 8a07d241ff
commit 93db3d42b7
2 changed files with 13 additions and 0 deletions

View File

@@ -35,6 +35,17 @@ describe('ol.format.GML2', function() {
expect(g.getCoordinates()).to.eql([-180, -90, 0]);
});
it('can read a box element', function() {
var text = '<gml:Box xmlns:gml="http://www.opengis.net/gml" ' +
'srsName="EPSG:4326">' +
' <gml:coordinates>-0.768746,47.003018 ' +
' 3.002191,47.925567</gml:coordinates>' +
'</gml:Box>';
var g = readGeometry(format, text);
expect(g).to.eql([47.003018, -0.768746, 47.925567, 3.002191]);
});
it('can read a multipolygon with gml:coordinates', function() {
var text =

View File

@@ -80,6 +80,8 @@ describe('ol.format.WFS', function() {
feature = features[0];
expect(feature.getId()).to.equal('1');
expect(feature.get('name')).to.equal('My Polygon with hole');
expect(feature.get('boundedBy')).to.eql(
[47.003018, -0.768746, 47.925567, 0.532597]);
expect(feature.getGeometry()).to.be.an(ol.geom.MultiPolygon);
expect(feature.getGeometry().getFlatCoordinates()).
to.have.length(60);