Skip to content
Permalink
Browse files

Don't include empty annotation layers in layout map exports

  • Loading branch information
nyalldawson committed Sep 1, 2020
1 parent 3710dbe commit 6a5eeca57917272786abd228637f141193b01797
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/core/layout/qgslayoutitemmap.cpp
@@ -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 ) );

0 comments on commit 6a5eeca

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