Ability to specify gmlOptions (e.g. srsName) in WFS transactions
This commit is contained in:
1
test/spec/ol/format/wfs/TransactionSrs.xml
Normal file
1
test/spec/ol/format/wfs/TransactionSrs.xml
Normal file
@@ -0,0 +1 @@
|
||||
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" service="WFS" version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><wfs:Insert><feature:FAULTS xmlns:feature="http://foo"><feature:the_geom><gml:MultiCurve xmlns:gml="http://www.opengis.net/gml" srsName="EPSG:900913"><gml:curveMember><gml:LineString srsName="EPSG:900913"><gml:posList>-5178372.1885436 1992365.7775042 -4434792.7774889 1601008.1927386 -4043435.1927233 2148908.8114105</gml:posList></gml:LineString></gml:curveMember></gml:MultiCurve></feature:the_geom><feature:TYPE>xyz</feature:TYPE></feature:FAULTS></wfs:Insert></wfs:Transaction>
|
||||
@@ -192,6 +192,36 @@ describe('ol.format.WFS', function() {
|
||||
|
||||
});
|
||||
|
||||
describe('when writing out a Transaction request', function() {
|
||||
var text;
|
||||
before(function(done) {
|
||||
afterLoadText('spec/ol/format/wfs/TransactionSrs.xml', function(xml) {
|
||||
text = xml;
|
||||
done();
|
||||
});
|
||||
});
|
||||
it('creates the correct srsName', function() {
|
||||
var format = new ol.format.WFS();
|
||||
var insertFeature = new ol.Feature({
|
||||
the_geom: new ol.geom.MultiLineString([[
|
||||
[-5178372.1885436, 1992365.7775042],
|
||||
[-4434792.7774889, 1601008.1927386],
|
||||
[-4043435.1927233, 2148908.8114105]
|
||||
]]),
|
||||
TYPE: 'xyz'
|
||||
});
|
||||
insertFeature.setGeometryName('the_geom');
|
||||
var inserts = [insertFeature];
|
||||
var serialized = format.writeTransaction(inserts, null, null, {
|
||||
featureNS: 'http://foo',
|
||||
featureType: 'FAULTS',
|
||||
featurePrefix: 'feature',
|
||||
gmlOptions: {multiCurve: true, srsName: 'EPSG:900913'}
|
||||
});
|
||||
expect(serialized).to.xmleql(ol.xml.load(text));
|
||||
});
|
||||
});
|
||||
|
||||
describe('when writing out a Transaction request', function() {
|
||||
var text;
|
||||
before(function(done) {
|
||||
@@ -317,6 +347,7 @@ describe('ol.format.WFS', function() {
|
||||
|
||||
goog.require('ol.xml');
|
||||
goog.require('ol.Feature');
|
||||
goog.require('ol.geom.MultiLineString');
|
||||
goog.require('ol.geom.MultiPoint');
|
||||
goog.require('ol.geom.MultiPolygon');
|
||||
goog.require('ol.geom.Polygon');
|
||||
|
||||
Reference in New Issue
Block a user