Write out valid WFS Transaction XML and ability to specify srsName

This commit is contained in:
Bart van den Eijnden
2014-05-21 10:28:32 +02:00
parent 98193c0336
commit 28d122e21e
3 changed files with 74 additions and 4 deletions

View File

@@ -222,6 +222,37 @@ describe('ol.format.WFS', function() {
});
});
describe('when writing out a Transaction request', function() {
var text;
before(function(done) {
afterLoadText('spec/ol/format/wfs/TransactionUpdate.xml', function(xml) {
text = xml;
done();
});
});
it('creates the correct update', function() {
var format = new ol.format.WFS();
var updateFeature = new ol.Feature();
updateFeature.setGeometryName('the_geom');
updateFeature.setGeometry(new ol.geom.MultiLineString([[
[-12279454.47665902, 6741885.67968707],
[-12064207.805007964, 6732101.740066567],
[-11941908.559751684, 6595126.585379533],
[-12240318.718177011, 6507071.128795006],
[-12416429.631346056, 6604910.52500003]
]]));
updateFeature.setId('FAULTS.4455');
var serialized = format.writeTransaction(null, [updateFeature], null, {
featureNS: 'http://foo',
featureType: 'FAULTS',
featurePrefix: 'foo',
gmlOptions: {srsName: 'EPSG:900913'}
});
expect(serialized).to.xmleql(ol.xml.load(text));
});
});
describe('when writing out a Transaction request', function() {
var text;
before(function(done) {