Skip to content

Commit c22effb

Browse files
committedApr 11, 2019
add for second case as well the default scale fallback
1 parent 8e62a89 commit c22effb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed
 

‎src/server/qgsserverprojectutils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ namespace QgsServerProjectUtils
157157
/**
158158
* Returns the denominator of the default scale used in case of the scale is not given
159159
* \param project the QGIS project
160-
* \return the denominator of the scale
160+
* \returns the denominator of the scale
161161
* \since QGIS 3.8
162162
*/
163163
SERVER_EXPORT double wmsDefaultMapUnitsPerMm( const QgsProject &project );

‎src/server/services/wms/qgswmsrenderer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ namespace QgsWms
176176
settings.setMapScale( mapSettings.scale() );
177177
settings.setMapUnitsPerPixel( mapSettings.mapUnitsPerPixel() );
178178
}
179+
else
180+
{
181+
double defaultMapUnitsPerPixel = QgsServerProjectUtils::wmsDefaultMapUnitsPerMm( *mContext.project() ) / mContext.dotsPerMm();
182+
settings.setMapUnitsPerPixel( defaultMapUnitsPerPixel );
183+
}
179184

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

0 commit comments

Comments
 (0)
Please sign in to comment.