port over another WFS 1.1 testcase
This commit is contained in:
@@ -54,7 +54,9 @@ ol.parser.ogc.WFS_v1_1_0 = function() {
|
||||
var options = obj.options;
|
||||
var node = obj.node;
|
||||
if (goog.isDef(options)) {
|
||||
node.setAttribute('resultType', options.resultType);
|
||||
if (goog.isDef(options.resultType)) {
|
||||
node.setAttribute('resultType', options.resultType);
|
||||
}
|
||||
if (goog.isDef(options.startIndex)) {
|
||||
node.setAttribute('startIndex', options.startIndex);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ describe('ol.parser.ogc.WFS_v1_1_0', function() {
|
||||
|
||||
});
|
||||
|
||||
it('handles writing GetFeature with PropertyName', function(done) {
|
||||
it('handles writing GetFeature with resultType hits', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_1_0/getfeature0.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_1_0();
|
||||
@@ -91,6 +91,24 @@ describe('ol.parser.ogc.WFS_v1_1_0', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it('handles writing GetFeature with paging info', function(done) {
|
||||
var url = 'spec/ol/parser/ogc/xml/wfs_v1_1_0/getfeature1.xml';
|
||||
afterLoadXml(url, function(xml) {
|
||||
var p = new ol.parser.ogc.WFS_v1_1_0();
|
||||
var output = p.writers[p.defaultNamespaceURI]['GetFeature'].apply(
|
||||
p, [{
|
||||
count: 10,
|
||||
startIndex: 20,
|
||||
srsName: 'urn:ogc:def:crs:EPSG::4326',
|
||||
featureNS: 'http://www.openplans.org/topp',
|
||||
featurePrefix: 'topp',
|
||||
featureTypes: ['states']
|
||||
}]);
|
||||
expect(goog.dom.xml.loadXml(p.serialize(output))).to.xmleql(xml);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
8
test/spec/ol/parser/ogc/xml/wfs_v1_1_0/getfeature1.xml
Normal file
8
test/spec/ol/parser/ogc/xml/wfs_v1_1_0/getfeature1.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<wfs:GetFeature service="WFS" version="1.1.0" startIndex="20" count="10" 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.1.0/wfs.xsd">
|
||||
<wfs:Query xmlns:wfs="http://www.opengis.net/wfs" typeName="topp:states" srsName="urn:ogc:def:crs:EPSG::4326" xmlns:topp="http://www.openplans.org/topp">
|
||||
</wfs:Query>
|
||||
</wfs:GetFeature>
|
||||
Reference in New Issue
Block a user