Set extent buffer in configureMapSettings

This commit is contained in:
Éric Lemoine 2019-06-18 15:43:05 +02:00
parent ebb2983ee3
commit c4b1431e92

View File

@ -751,18 +751,13 @@ namespace QgsWms
QgsMapSettings mapSettings;
configureLayers( layers, &mapSettings );
const QSize mapSize = mContext.mapSize();
// create the output image and the painter
std::unique_ptr<QPainter> painter;
std::unique_ptr<QImage> image( createImage( mapSize ) );
std::unique_ptr<QImage> image( createImage( mContext.mapSize() ) );
// configure map settings (background, DPI, ...)
configureMapSettings( image.get(), mapSettings );
// set the extent buffer in the map settings
mapSettings.setExtentBuffer( mContext.mapTileBuffer( mapSize.width() ) );
// add layers to map settings
mapSettings.setLayers( layers );
@ -1033,6 +1028,9 @@ namespace QgsWms
mapSettings.setExtent( mapExtent );
// set the extent buffer
mapSettings.setExtentBuffer( mContext.mapTileBuffer( paintDevice->width() ) );
/* Define the background color
* Transparent or colored
*/