Skip to content

Commit

Permalink
Merge pull request #30224 from rldhont/server-getcontext-fix-hidden-r…
Browse files Browse the repository at this point in the history
…elease-3_4

[Backport release-3_4]GetContext: Fix hidden attribute value based on tree layer visibility
  • Loading branch information
rldhont committed Jun 15, 2019
2 parents b8e9ed8 + a8323a5 commit 853abe0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/server/services/wms/qgswmsgetcontext.cpp
Expand Up @@ -284,11 +284,11 @@ namespace QgsWms
// visibility
if ( treeLayer->itemVisibilityChecked() )
{
layerElem.setAttribute( QStringLiteral( "hidden" ), QStringLiteral( "true" ) );
layerElem.setAttribute( QStringLiteral( "hidden" ), QStringLiteral( "false" ) );
}
else
{
layerElem.setAttribute( QStringLiteral( "hidden" ), QStringLiteral( "false" ) );
layerElem.setAttribute( QStringLiteral( "hidden" ), QStringLiteral( "true" ) );
}

// layer group
Expand Down
8 changes: 4 additions & 4 deletions tests/testdata/qgis_server/getcontext.txt
Expand Up @@ -13,7 +13,7 @@ Content-Type: text/xml; charset=utf-8
</ows:BoundingBox>
</General>
<ResourceList>
<Layer group="groupwithoutshortname" hidden="true" queryable="false" id="testlayer3" name="testlayer3" opacity="1">
<Layer group="groupwithoutshortname" hidden="false" queryable="false" id="testlayer3" name="testlayer3" opacity="1">
<ows:Title>testlayer3</ows:Title>
<ows:OutputFormat>image/png</ows:OutputFormat>
<Server default="true" service="urn:ogc:serviceType:WMS" version="1.3.0">
Expand All @@ -26,7 +26,7 @@ Content-Type: text/xml; charset=utf-8
</Style>
</StyleList>
</Layer>
<Layer group="groupwithshortname" hidden="true" queryable="true" id="testlayer2" name="testlayer2" opacity="1">
<Layer group="groupwithshortname" hidden="false" queryable="true" id="testlayer2" name="testlayer2" opacity="1">
<ows:Title>testlayer2</ows:Title>
<ows:OutputFormat>image/png</ows:OutputFormat>
<Server default="true" service="urn:ogc:serviceType:WMS" version="1.3.0">
Expand All @@ -39,7 +39,7 @@ Content-Type: text/xml; charset=utf-8
</Style>
</StyleList>
</Layer>
<Layer hidden="true" queryable="true" id="testlayer_èé" name="testlayer èé" opacity="1">
<Layer hidden="false" queryable="true" id="testlayer_èé" name="testlayer èé" opacity="1">
<ows:Title>A test vector layer</ows:Title>
<ows:OutputFormat>image/png</ows:OutputFormat>
<Server default="true" service="urn:ogc:serviceType:WMS" version="1.3.0">
Expand All @@ -53,7 +53,7 @@ Content-Type: text/xml; charset=utf-8
</Style>
</StyleList>
</Layer>
<Layer hidden="true" queryable="true" id="layer_with_short_name" name="layer_with_short_name" opacity="1">
<Layer hidden="false" queryable="true" id="layer_with_short_name" name="layer_with_short_name" opacity="1">
<ows:Title>A Layer with a short name</ows:Title>
<ows:OutputFormat>image/png</ows:OutputFormat>
<Server default="true" service="urn:ogc:serviceType:WMS" version="1.3.0">
Expand Down

0 comments on commit 853abe0

Please sign in to comment.