Skip to content

Commit

Permalink
Don't include empty annotation layers in layout map exports
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 1, 2020
1 parent 3710dbe commit 6a5eeca
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/layout/qgslayoutitemmap.cpp
Expand Up @@ -1469,8 +1469,11 @@ QgsMapSettings QgsLayoutItemMap::mapSettings( const QgsRectangle &extent, QSizeF
//set layers to render
QList<QgsMapLayer *> layers = layersToRender( &expressionContext );

// render main annotation layer above all other layers
layers.insert( 0, mLayout->project()->mainAnnotationLayer() );
if ( !mLayout->project()->mainAnnotationLayer()->isEmpty() )
{
// render main annotation layer above all other layers
layers.insert( 0, mLayout->project()->mainAnnotationLayer() );
}

jobMapSettings.setLayers( layers );
jobMapSettings.setLayerStyleOverrides( layerStyleOverridesToRender( expressionContext ) );
Expand Down

0 comments on commit 6a5eeca

Please sign in to comment.