Skip to content

Commit

Permalink
Merge pull request #5400 from pblottiere/server_bugfix_visible
Browse files Browse the repository at this point in the history
[server][bugfix] Fix regression by adding visible tag to layer's node in GetProjectSettings
  • Loading branch information
pblottiere committed Oct 26, 2017
2 parents d40447e + 1c9f9df commit d414822
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/server/services/wms/qgswmsgetcapabilities.cpp
Expand Up @@ -828,6 +828,12 @@ namespace QgsWms
{
QgsLayerTreeNode *treeNode = layerTreeGroupChildren.at( i );
QDomElement layerElem = doc.createElement( QStringLiteral( "Layer" ) );

if ( projectSettings )
{
layerElem.setAttribute( QStringLiteral( "visible" ), treeNode->isVisible() );
}

if ( treeNode->nodeType() == QgsLayerTreeNode::NodeGroup )
{
QgsLayerTreeGroup *treeGroupChild = static_cast<QgsLayerTreeGroup *>( treeNode );
Expand All @@ -840,7 +846,6 @@ namespace QgsWms

if ( projectSettings )
{
layerElem.setAttribute( QStringLiteral( "visible" ), treeGroupChild->isVisible() );
layerElem.setAttribute( QStringLiteral( "mutuallyExclusive" ), treeGroupChild->isMutuallyExclusive() );
}

Expand Down
2 changes: 1 addition & 1 deletion tests/testdata/qgis_server/getprojectsettings.txt
Expand Up @@ -128,7 +128,7 @@ Content-Type: text/xml; charset=utf-8
<BoundingBox maxy="5.60604e+06" maxx="913283" miny="5.60599e+06" CRS="EPSG:3857" minx="913171"/>
<BoundingBox maxy="8.20416" maxx="44.9016" miny="8.20315" CRS="EPSG:4326" minx="44.9012"/>
<TreeName>QGIS Test Project</TreeName>
<Layer geometryType="Point" queryable="1" displayField="name">
<Layer geometryType="Point" queryable="1" displayField="name" visible="1">
<Name>testlayer èé</Name>
<Title>A test vector layer</Title>
<Abstract>A test vector layer with unicode òà</Abstract>
Expand Down

0 comments on commit d414822

Please sign in to comment.