Skip to content
Permalink
Browse files

Adding AUTO value to RULELABEL parameter and keep existing logic

  • Loading branch information
uprel committed May 10, 2020
1 parent ebea9ce commit f957b9f633338acb338d9904ad6fc5cdd6986289
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/server/services/wms/qgswmsgetlegendgraphics.cpp
@@ -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 ) )
@@ -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 );
}
}

0 comments on commit f957b9f

Please sign in to comment.
You can’t perform that action at this time.