File tree 1 file changed +8
-0
lines changed
1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -782,6 +782,11 @@ QImage* QgsWMSServer::getLegendGraphics()
782
782
}
783
783
}
784
784
}
785
+
786
+ // Checks showFeatureCount parameter
787
+ bool showFeatureCount = false ;
788
+ if ( mParameters .contains ( " SHOWFEATURECOUNT" ) )
789
+ showFeatureCount = QVariant (mParameters [ " SHOWFEATURECOUNT" ]).toBool ();
785
790
786
791
// Create the layer tree root
787
792
QgsLayerTreeGroup rootGroup;
@@ -799,6 +804,9 @@ QImage* QgsWMSServer::getLegendGraphics()
799
804
// set layer name with layer's title to have it in legend
800
805
if ( !ml->title ().isEmpty () )
801
806
layer->setLayerName ( ml->title () );
807
+ // set show feature count
808
+ if ( showFeatureCount )
809
+ layer->setCustomProperty ( " showFeatureCount" , showFeatureCount );
802
810
}
803
811
QgsLayerTreeModel legendModel ( &rootGroup );
804
812
You can’t perform that action at this time.
0 commit comments