Skip to content

Commit

Permalink
Merge pull request #5425 from pblottiere/server_getfeatureinfo
Browse files Browse the repository at this point in the history
[server][bugfix] Consider QUERY_LAYERS as valid layers in GetFeatureInfo
  • Loading branch information
pblottiere committed Oct 27, 2017
2 parents c9ca175 + 98c05ad commit dfaabdc
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -956,6 +956,16 @@ namespace QgsWms
else
layers = stylizedLayers( params );

// add QUERY_LAYERS to list of available layers for more flexibility
for ( const QString &queryLayer : queryLayers )
{
if ( mNicknameLayers.contains( queryLayer )
&& !layers.contains( mNicknameLayers[queryLayer] ) )
{
layers.append( mNicknameLayers[queryLayer] );
}
}

// create the mapSettings and the output image
QgsMapSettings mapSettings;
std::unique_ptr<QImage> outputImage( createImage() );
Expand Down
8 changes: 8 additions & 0 deletions tests/src/python/test_qgsserver_wms.py
Expand Up @@ -84,6 +84,14 @@ def test_getfeatureinfo(self):
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320',
'wms_getfeatureinfo-text-xml')

self.wms_request_compare('GetFeatureInfo',
'&layers=&styles=&' +
'info_format=text%2Fxml&transparent=true&' +
'width=600&height=400&srs=EPSG%3A3857&bbox=913190.6389747962%2C' +
'5606005.488876367%2C913235.426296057%2C5606035.347090538&' +
'query_layers=testlayer%20%C3%A8%C3%A9&X=190&Y=320',
'wms_getfeatureinfo-text-xml')

# Test getfeatureinfo response html
self.wms_request_compare('GetFeatureInfo',
'&layers=testlayer%20%C3%A8%C3%A9&styles=&' +
Expand Down

0 comments on commit dfaabdc

Please sign in to comment.