diff --git a/app/maptools/measurementmaptool.cpp b/app/maptools/measurementmaptool.cpp index 8ae172067d..f1db80c7aa 100644 --- a/app/maptools/measurementmaptool.cpp +++ b/app/maptools/measurementmaptool.cpp @@ -108,10 +108,9 @@ void MeasurementMapTool::closeShape() QgsDistanceArea distanceArea; double area = distanceArea.measureArea( polygonGeometry ); - double perimeter = distanceArea.measureLength( polygonGeometry ); + double perimeter = distanceArea.measurePerimeter( polygonGeometry ); - emit shapeArea( area ); - emit shapePerimeter( perimeter ); + emit shapeAreaAndPerimeter( area , perimeter ); emit canCloseShape( false ); } diff --git a/app/maptools/measurementmaptool.h b/app/maptools/measurementmaptool.h index d50dfd00e4..d56e9bf933 100644 --- a/app/maptools/measurementmaptool.h +++ b/app/maptools/measurementmaptool.h @@ -55,8 +55,7 @@ class MeasurementMapTool : public AbstractMapTool void canCloseShape( bool canClose ); void canUndo( bool canUndo ); - void shapeArea( double area ); - void shapePerimeter( double perimeter ); + void shapeAreaAndPerimeter( double area , double perimeter ); protected: void rebuildGeometry(); diff --git a/app/qml/gps/MMMeasureDrawer.qml b/app/qml/gps/MMMeasureDrawer.qml index 170bc84afc..eee67eec81 100644 --- a/app/qml/gps/MMMeasureDrawer.qml +++ b/app/qml/gps/MMMeasureDrawer.qml @@ -30,7 +30,7 @@ MMDrawer { property string length: qsTr( "0.0 m" ) property string perimeter: qsTr( "0.0 m" ) - property string area: qsTr( "0.0 m" ) + property string area: qsTr( "0.0 m²" ) signal addMeasurePoint() signal measureFinished() diff --git a/app/qml/map/MMMeasurementTools.qml b/app/qml/map/MMMeasurementTools.qml index b0cf2ab795..3bb9f55fc3 100644 --- a/app/qml/map/MMMeasurementTools.qml +++ b/app/qml/map/MMMeasurementTools.qml @@ -33,12 +33,9 @@ Item { measurePanel.canCloseShape = canClose; } - onShapeArea: function( area ) { - measurePanel.area = area; - } - - onShapePerimeter: function( perimeter ) { - measurePanel.perimeter = perimeter; + onShapeAreaAndPerimeter: function( area, perimeter) { + measurePanel.area = area.toFixed( 1 ) + " m²";; + measurePanel.perimeter = perimeter.toFixed( 1 ) + " m";; } onCanUndo: function( canUndo ) { @@ -102,17 +99,11 @@ Item { anchors.fill: parent qgsProject: __activeProject.qgsProject mapSettings: root.map.mapSettings - //hasLabel: true - //crosshairLabelText: qsTr( "N/A") - //crosshairLabelIcon: measurePanel.canCloseShape ? __style.closeShapeIcon : "" } MMMapLabel { id: mapLabel - anchors.top: crosshair.bottom - anchors.horizontalCenter: crosshair.horizontalCenter - text: qsTr( "0.0 m" ) bgColor: __style.forestColor textColor: __style.polarColor