diff --git a/app/maptools/measurementmaptool.cpp b/app/maptools/measurementmaptool.cpp index a95419141e..4d68c1f2fe 100644 --- a/app/maptools/measurementmaptool.cpp +++ b/app/maptools/measurementmaptool.cpp @@ -88,7 +88,9 @@ double MeasurementMapTool::updateDistance( const QgsPoint &crosshairPoint ) QgsDistanceArea mDistanceArea; mDistanceArea.setEllipsoid( QStringLiteral( "WGS84" ) ); - mDistanceArea.setSourceCrs( mapSettings()->destinationCrs(), mapSettings()->transformContext() ); + //mDistanceArea.setSourceCrs( mapSettings()->destinationCrs(), mapSettings()->transformContext() ); + + mDistanceArea.setSourceCrs( QgsCoordinateReferenceSystem::fromEpsgId( 4326 ), QgsCoordinateTransformContext() ); return mDistanceArea.measureLine( crosshairPoint, lastPoint ); } @@ -110,7 +112,9 @@ void MeasurementMapTool::closeShape() QgsDistanceArea mDistanceArea; mDistanceArea.setEllipsoid( QStringLiteral( "WGS84" ) ); - mDistanceArea.setSourceCrs( mapSettings()->destinationCrs(), mapSettings()->transformContext() ); + //mDistanceArea.setSourceCrs( mapSettings()->destinationCrs(), mapSettings()->transformContext() ); + + mDistanceArea.setSourceCrs( QgsCoordinateReferenceSystem::fromEpsgId( 4326 ), QgsCoordinateTransformContext() ); double area = mDistanceArea.measureArea( polygonGeometry ); double perimeter = mDistanceArea.measurePerimeter( polygonGeometry ); diff --git a/app/qml/map/MMMeasurementTools.qml b/app/qml/map/MMMeasurementTools.qml index 32e52a1f9a..f256fef0d2 100644 --- a/app/qml/map/MMMeasurementTools.qml +++ b/app/qml/map/MMMeasurementTools.qml @@ -36,7 +36,7 @@ Item { onCanUndo: function( canUndo ) { measurePanel.canUndo = canUndo; } onShapeAreaAndPerimeter: function( area, perimeter) { measurePanel.area = area.toFixed( 1 ) + " m²"; - measurePanel.perimeter = perimeter.toFixed( 1 ) + " m"; + measurePanel.perimeter = __inputUtils.formatDistanceInProjectUnit( perimeter, 1 ) //perimeter.toFixed( 1 ) + " m"; } } @@ -116,8 +116,7 @@ Item { function onScreenPositionChanged() { let distance = mapTool.updateDistance( crosshair.recordPoint ); - measurePanel.length = distance.toFixed( 1 ) + " m"; - + measurePanel.length = __inputUtils.formatDistanceInProjectUnit( distance, 1 ); //distance.toFixed( 1 ) + " m"; if ( measurePanel.canCloseShape ) { mapLabel.text = qsTr( "Close shape" ) mapLabel.iconSource = __style.closeShapeIcon