ability to write out PropertyNames in a GetFeature request

This commit is contained in:
Bart van den Eijnden
2013-10-22 17:26:55 +02:00
parent 557390f2ad
commit 0581a49378
5 changed files with 31 additions and 5 deletions

View File

@@ -37,6 +37,20 @@ describe('ol.parser.ogc.WFS_v1_0_0', function() {
});
});
it('handles writing GetFeature with PropertyName', function(done) {
var url = 'spec/ol/parser/ogc/xml/wfs_v1_0_0/getfeature0.xml';
afterLoadXml(url, function(xml) {
var p = new ol.parser.ogc.WFS_v1_0_0({featureTypes: ['states'],
featurePrefix: 'topp', featureNS: 'http://www.openplans.org/topp'});
var output = p.writers[p.defaultNamespaceURI]['GetFeature'].apply(
p, [{propertyNames: [new ol.expr.Identifier('STATE_NAME'),
new ol.expr.Identifier('STATE_FIPS'),
new ol.expr.Identifier('STATE_ABBR')]}]);
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
done();
});
});
});
});

View File

@@ -0,0 +1,11 @@
<wfs:GetFeature service="WFS" version="1.0.0" xmlns:topp="http://www.openplans.org/topp"
xmlns:wfs="http://www.opengis.net/wfs"
xmlns:ogc="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd">
<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" xmlns:topp="http://www.openplans.org/topp">
<ogc:PropertyName>STATE_NAME</ogc:PropertyName>
<ogc:PropertyName>STATE_FIPS</ogc:PropertyName>
<ogc:PropertyName>STATE_ABBR</ogc:PropertyName>
</wfs:Query>
</wfs:GetFeature>