Add gml:MultiPoint parsing

This commit is contained in:
Bart van den Eijnden
2014-02-20 20:30:04 +01:00
parent 95bbb849bb
commit aa4d798dc7
2 changed files with 87 additions and 0 deletions

View File

@@ -153,6 +153,35 @@ describe('ol.format.GML', function() {
});
describe('multipoint', function() {
it('can read a singular multipoint geometry', function() {
var text =
'<gml:MultiPoint xmlns:gml="http://www.opengis.net/gml" ' +
' srsName="foo">' +
' <gml:pointMember>' +
' <gml:Point>' +
' <gml:pos>1 2</gml:pos>' +
' </gml:Point>' +
' </gml:pointMember>' +
' <gml:pointMember>' +
' <gml:Point>' +
' <gml:pos>2 3</gml:pos>' +
' </gml:Point>' +
' </gml:pointMember>' +
' <gml:pointMember>' +
' <gml:Point>' +
' <gml:pos>3 4</gml:pos>' +
' </gml:Point>' +
' </gml:pointMember>' +
'</gml:MultiPoint>';
var g = format.readGeometry(text);
expect(g).to.be.an(ol.geom.MultiPoint);
expect(g.getCoordinates()).to.eql([[1, 2, 0], [2, 3, 0], [3, 4, 0]]);
});
});
});
});
@@ -160,5 +189,6 @@ describe('ol.format.GML', function() {
goog.require('ol.format.GML');
goog.require('ol.geom.LineString');
goog.require('ol.geom.MultiPoint');
goog.require('ol.geom.Point');
goog.require('ol.geom.Polygon');