Skip to content

Commit

Permalink
Append distance area when using defaultMapUnitsPerMm to consider the …
Browse files Browse the repository at this point in the history
…correct CRS and care about meter based crs. This fixes #50366
  • Loading branch information
signedav authored and nyalldawson committed Apr 1, 2023
1 parent fd55a84 commit 5f6ae24
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/server/services/wms/qgswmsrenderer.cpp
Expand Up @@ -147,6 +147,10 @@ namespace QgsWms
context.setScaleFactor( mContext.dotsPerMm() );
const double mmPerMapUnit = 1 / QgsServerProjectUtils::wmsDefaultMapUnitsPerMm( *mProject );
context.setMapToPixel( QgsMapToPixel( 1 / ( mmPerMapUnit * context.scaleFactor() ) ) );
QgsDistanceArea distanceArea;
distanceArea.setSourceCrs( QgsCoordinateReferenceSystem( mWmsParameters.crs() ), mProject->transformContext() );
distanceArea.setEllipsoid( geoNone() );
context.setDistanceArea( distanceArea );
}

// create image according to context
Expand Down

0 comments on commit 5f6ae24

Please sign in to comment.