Use geometry name in WFS updates

This commit is contained in:
bartvde
2017-08-31 15:54:26 +02:00
parent 48bcaf395f
commit 2d3fa05b91
2 changed files with 32 additions and 1 deletions

View File

@@ -696,6 +696,27 @@ describe('ol.format.WFS', function() {
});
expect(serialized).to.xmleql(ol.xml.parse(text));
});
it('creates the correct update if geometry name is alias', function() {
var format = new ol.format.WFS();
var updateFeature = new ol.Feature(new ol.geom.MultiLineString([[
[-12279454, 6741885],
[-12064207, 6732101],
[-11941908, 6595126],
[-12240318, 6507071],
[-12416429, 6604910]
]]));
updateFeature.setGeometryName('the_geom');
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.parse(text));
});
});
describe('when writing out a Transaction request', function() {
@@ -809,6 +830,7 @@ describe('ol.format.WFS', function() {
unwritten: undefined
});
updateFeature.setId('fid.42');
updateFeature.setGeometryName('the_geom');
var updates = [updateFeature];
var deleteFeature = new ol.Feature();
@@ -878,6 +900,7 @@ describe('ol.format.WFS', function() {
unwritten: undefined
});
updateFeature.setId('fid.42');
updateFeature.setGeometryName('the_geom');
var updates = [updateFeature];
var deleteFeature = new ol.Feature();
@@ -921,6 +944,7 @@ describe('ol.format.WFS', function() {
unwritten: undefined
});
updateFeature.setId('fid.42');
updateFeature.setGeometryName('the_geom');
var updates = [updateFeature];
var deleteFeature = new ol.Feature();
@@ -962,6 +986,7 @@ describe('ol.format.WFS', function() {
// undefined value means don't create a Property element
unwritten: undefined
});
updateFeature.setGeometryName('the_geom');
updateFeature.setId('fid.42');
var updates = [updateFeature];
@@ -1003,6 +1028,7 @@ describe('ol.format.WFS', function() {
// undefined value means don't create a Property element
unwritten: undefined
});
updateFeature.setGeometryName('the_geom');
updateFeature.setId('fid.42');
var updates = [updateFeature];