Server: fix atlas fixed scales

Fixes #49900
This commit is contained in:
Alessandro Pasotti 2022-09-14 15:27:58 +02:00
parent ae0076a056
commit cc97a38bcb

View File

@ -29,6 +29,7 @@
#include "qgsgeometry.h" #include "qgsgeometry.h"
#include "qgsmapserviceexception.h" #include "qgsmapserviceexception.h"
#include "qgslayertree.h" #include "qgslayertree.h"
#include "qgslayoututils.h"
#include "qgslayertreemodel.h" #include "qgslayertreemodel.h"
#include "qgslegendrenderer.h" #include "qgslegendrenderer.h"
#include "qgsmaplayer.h" #include "qgsmaplayer.h"
@ -503,6 +504,8 @@ namespace QgsWms
if ( ok ) if ( ok )
exportSettings.dpi = dpi; exportSettings.dpi = dpi;
} }
// Set scales
exportSettings.predefinedMapScales = QgsLayoutUtils::predefinedScales( layout.get( ) );
// Draw selections // Draw selections
exportSettings.flags |= QgsLayoutRenderContext::FlagDrawSelection; exportSettings.flags |= QgsLayoutRenderContext::FlagDrawSelection;
if ( atlas ) if ( atlas )
@ -536,6 +539,8 @@ namespace QgsWms
dpi = _dpi; dpi = _dpi;
} }
exportSettings.dpi = dpi; exportSettings.dpi = dpi;
// Set scales
exportSettings.predefinedMapScales = QgsLayoutUtils::predefinedScales( layout.get( ) );
// Draw selections // Draw selections
exportSettings.flags |= QgsLayoutRenderContext::FlagDrawSelection; exportSettings.flags |= QgsLayoutRenderContext::FlagDrawSelection;
// Destination image size in px // Destination image size in px
@ -607,6 +612,8 @@ namespace QgsWms
exportSettings.flags |= QgsLayoutRenderContext::FlagDrawSelection; exportSettings.flags |= QgsLayoutRenderContext::FlagDrawSelection;
// Print as raster // Print as raster
exportSettings.rasterizeWholeImage = layout->customProperty( QStringLiteral( "rasterize" ), false ).toBool(); exportSettings.rasterizeWholeImage = layout->customProperty( QStringLiteral( "rasterize" ), false ).toBool();
// Set scales
exportSettings.predefinedMapScales = QgsLayoutUtils::predefinedScales( layout.get( ) );
// Export all pages // Export all pages
if ( atlas ) if ( atlas )