Skip to content
Permalink
Browse files

add for second case as well the default scale fallback

  • Loading branch information
signedav committed Apr 11, 2019
1 parent 8e62a89 commit c22effb545b5e042ee5591b4b2dbe34430a3d2c9
Showing with 6 additions and 1 deletion.
  1. +1 −1 src/server/qgsserverprojectutils.h
  2. +5 −0 src/server/services/wms/qgswmsrenderer.cpp
@@ -157,7 +157,7 @@ namespace QgsServerProjectUtils
/**
* Returns the denominator of the default scale used in case of the scale is not given
* \param project the QGIS project
* \return the denominator of the scale
* \returns the denominator of the scale
* \since QGIS 3.8
*/
SERVER_EXPORT double wmsDefaultMapUnitsPerMm( const QgsProject &project );
@@ -176,6 +176,11 @@ namespace QgsWms
settings.setMapScale( mapSettings.scale() );
settings.setMapUnitsPerPixel( mapSettings.mapUnitsPerPixel() );
}
else
{
double defaultMapUnitsPerPixel = QgsServerProjectUtils::wmsDefaultMapUnitsPerMm( *mContext.project() ) / mContext.dotsPerMm();
settings.setMapUnitsPerPixel( defaultMapUnitsPerPixel );
}

// create image
const int width = mWmsParameters.widthAsInt();

0 comments on commit c22effb

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