Add GML2 MultiLineString serialiazer
This commit is contained in:
@@ -254,6 +254,37 @@ describe('ol.format.GML2', function() {
|
||||
|
||||
expect(node).to.xmleql(ol.xml.parse(expected));
|
||||
});
|
||||
|
||||
it('can serialize a Multi Line String', function() {
|
||||
var expected =
|
||||
'<layer xmlns="http://www.openlayers.org/" fid="1">' +
|
||||
' <geometry>' +
|
||||
' <MultiLineString xmlns="http://www.opengis.net/gml" ' +
|
||||
' srsName="EPSG:4326">' +
|
||||
' <lineStringMember>' +
|
||||
' <LineString srsName="EPSG:4326">' +
|
||||
' <coordinates ' +
|
||||
' decimal="." cs="," ts=" ">' +
|
||||
' 2,1.1 4.2,3' +
|
||||
' </coordinates>' +
|
||||
' </LineString>' +
|
||||
' </lineStringMember>' +
|
||||
' </MultiLineString>' +
|
||||
' </geometry>' +
|
||||
' </layer>';
|
||||
|
||||
var feature = new ol.Feature({
|
||||
geometry: new ol.geom.MultiLineString([[[1.1, 2], [3, 4.2]]])
|
||||
});
|
||||
feature.setId(1);
|
||||
var objectStack = [{
|
||||
featureNS: featureNS,
|
||||
srsName: 'EPSG:4326'
|
||||
}];
|
||||
format.writeFeatureElement(node, feature, objectStack);
|
||||
|
||||
expect(node).to.xmleql(ol.xml.parse(expected));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user