Add tests for gml2 gml:box element
This commit is contained in:
@@ -35,6 +35,17 @@ describe('ol.format.GML2', function() {
|
|||||||
expect(g.getCoordinates()).to.eql([-180, -90, 0]);
|
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() {
|
it('can read a multipolygon with gml:coordinates', function() {
|
||||||
|
|
||||||
var text =
|
var text =
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ describe('ol.format.WFS', function() {
|
|||||||
feature = features[0];
|
feature = features[0];
|
||||||
expect(feature.getId()).to.equal('1');
|
expect(feature.getId()).to.equal('1');
|
||||||
expect(feature.get('name')).to.equal('My Polygon with hole');
|
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()).to.be.an(ol.geom.MultiPolygon);
|
||||||
expect(feature.getGeometry().getFlatCoordinates()).
|
expect(feature.getGeometry().getFlatCoordinates()).
|
||||||
to.have.length(60);
|
to.have.length(60);
|
||||||
|
|||||||
Reference in New Issue
Block a user