ability to write out PropertyNames in a GetFeature request
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
11
test/spec/ol/parser/ogc/xml/wfs_v1_0_0/getfeature0.xml
Normal file
11
test/spec/ol/parser/ogc/xml/wfs_v1_0_0/getfeature0.xml
Normal 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>
|
||||
Reference in New Issue
Block a user