Skip to content
Permalink
Browse files

[FEATURE][QGIS-Server] showFeatureCount in GetLegendGraphic

Add non standard parameter 'ShowFeatureCount' to add feature count in the legend.
  • Loading branch information
rldhont committed Dec 10, 2015
1 parent ac5ff0c commit f27e6c27b55c3292da81bfd209d3e1156f73f529
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/server/qgswmsserver.cpp
@@ -782,6 +782,11 @@ QImage* QgsWMSServer::getLegendGraphics()
}
}
}

// Checks showFeatureCount parameter
bool showFeatureCount = false;
if ( mParameters.contains( "SHOWFEATURECOUNT" ) )
showFeatureCount = QVariant(mParameters[ "SHOWFEATURECOUNT" ]).toBool();

This comment has been minimized.


// Create the layer tree root
QgsLayerTreeGroup rootGroup;
@@ -799,6 +804,9 @@ QImage* QgsWMSServer::getLegendGraphics()
// set layer name with layer's title to have it in legend
if ( !ml->title().isEmpty() )
layer->setLayerName( ml->title() );
// set show feature count
if ( showFeatureCount )
layer->setCustomProperty( "showFeatureCount", showFeatureCount );
}
QgsLayerTreeModel legendModel( &rootGroup );

0 comments on commit f27e6c2

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