We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
qgis
Learn more about funding links in repositories.
Report abuse
There was an error while loading. Please reload this page.
1 parent 6bde8a2 commit 4ac94f2Copy full SHA for 4ac94f2
src/core/qgslegendrenderer.cpp
@@ -208,6 +208,12 @@ QList<QgsLegendRenderer::Atom> QgsLegendRenderer::createAtomList( QgsLayerTreeGr
208
209
QList<QgsLayerTreeModelLegendNode*> legendNodes = mLegendModel->layerLegendNodes( nodeLayer );
210
211
+ // workaround for the issue that "filtering by map" does not remove layer nodes that have no symbols present
212
+ // on the map. We explicitly skip such layers here. In future ideally that should be handled directly
213
+ // in the layer tree model
214
+ if ( legendNodes.isEmpty() && mLegendModel->legendFilterByMap() )
215
+ continue;
216
+
217
QList<Atom> layerAtoms;
218
219
for ( int j = 0; j < legendNodes.count(); j++ )
0 commit comments