Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Adding AUTO value to RULELABEL parameter and keep existing logic
  • Loading branch information
uprel committed May 12, 2020
1 parent ebea9ce commit f957b9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/server/services/wms/qgswmsgetlegendgraphics.cpp
Expand Up @@ -266,6 +266,7 @@ namespace QgsWms
if ( parameters.rule().isEmpty() )
{
QList<QgsLayerTreeNode *> children = tree.children();
QString ruleLabel = parameters.ruleLabel();
for ( QgsLayerTreeNode *node : children )
{
if ( ! QgsLayerTree::isLayer( node ) )
Expand All @@ -284,13 +285,12 @@ namespace QgsWms
legendNode->setUserLabel( QStringLiteral( " " ) );
}
}
// rulelabel is not set or true
else if ( !parameters.layerTitleAsBool() )
else if (ruleLabel.compare( QStringLiteral( "AUTO" ), Qt::CaseInsensitive ) == 0)
{
for ( QgsLayerTreeModelLegendNode *legendNode : model->layerLegendNodes( nodeLayer ) )
{
//clearing label when rulelabel is not set and only for single symbol
if ( legendNode->isEmbeddedInParent() && parameters.ruleLabel().isEmpty() )
//clearing label for single symbol
if ( legendNode->isEmbeddedInParent() )
legendNode->setEmbeddedInParent( false );
}
}
Expand Down

0 comments on commit f957b9f

Please sign in to comment.