Add GML2 serializer for MultiPoint

This commit is contained in:
Julien Enselme
2017-02-17 16:39:48 +01:00
parent f8c6863fa7
commit 650837b207
2 changed files with 68 additions and 1 deletions

View File

@@ -223,6 +223,37 @@ describe('ol.format.GML2', function() {
expect(node).to.xmleql(ol.xml.parse(expected));
});
it('can serialize a Multi Point', function() {
var expected =
'<layer xmlns="http://www.openlayers.org/" fid="1">' +
' <geometry>' +
' <MultiPoint xmlns="http://www.opengis.net/gml" ' +
' srsName="EPSG:4326">' +
' <pointMember>' +
' <Point srsName="EPSG:4326">' +
' <coordinates ' +
' decimal="." cs="," ts=" ">' +
' 2,1.1' +
' </coordinates>' +
' </Point>' +
' </pointMember>' +
' </MultiPoint>' +
' </geometry>' +
' </layer>';
var feature = new ol.Feature({
geometry: new ol.geom.MultiPoint([[1.1, 2]])
});
feature.setId(1);
var objectStack = [{
featureNS: featureNS,
srsName: 'EPSG:4326'
}];
format.writeFeatureElement(node, feature, objectStack);
expect(node).to.xmleql(ol.xml.parse(expected));
});
});
});