Add layerName option for WMSGetFeatureInfo format

This option allows the format to read only features of a
given layer. This is useful if you wish to make a single
query to a WMS server with multiple layers in it.
This commit is contained in:
Alexandre Dubé
2016-01-21 10:54:26 -05:00
parent b9c3981261
commit 906a132e89
6 changed files with 384 additions and 2 deletions

View File

@@ -140,6 +140,18 @@ describe('ol.format.WMSGetFeatureInfo', function() {
expect(features.length).to.be(2);
expect(features[0].get('OBJECTID')).to.be('287');
expect(features[1].get('OBJECTID')).to.be('1251');
var aaa64Features = new ol.format.WMSGetFeatureInfo({
layers: ['AAA64']
}).readFeatures(text);
expect(aaa64Features.length).to.be(1);
var allFeatures = new ol.format.WMSGetFeatureInfo({
layers: ['AAA64', 'AAA62']
}).readFeatures(text);
expect(allFeatures.length).to.be(2);
var dummyFeatures = new ol.format.WMSGetFeatureInfo({
layers: ['foo', 'bar']
}).readFeatures(text);
expect(dummyFeatures.length).to.be(0);
});
it('read geoservers response', function() {