Skip to content

Commit

Permalink
add for second case as well the default scale fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Apr 11, 2019
1 parent 8e62a89 commit c22effb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/server/qgsserverprojectutils.h
Expand Up @@ -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 );
Expand Down
5 changes: 5 additions & 0 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -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();
Expand Down

0 comments on commit c22effb

Please sign in to comment.