From 7d368a8f7d49d23d14dd727888e9358c5749b77a Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Thu, 25 Apr 2024 03:55:50 -0300 Subject: [PATCH 1/4] starting of fixing --- app/inpututils.cpp | 2 ++ app/qml/main.qml | 4 ++++ app/qml/map/MMMapController.qml | 3 ++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/inpututils.cpp b/app/inpututils.cpp index c6e26183f..f8e5aed12 100644 --- a/app/inpututils.cpp +++ b/app/inpututils.cpp @@ -1834,6 +1834,8 @@ bool InputUtils::isPointLayerFeature( const FeatureLayerPair &feature ) void InputUtils::zoomToProject( QgsProject *qgsProject, InputMapSettings *mapSettings ) { + //change gps lock status + if ( !qgsProject || !mapSettings ) { qDebug() << "Cannot zoom to extent, MapSettings or QgsProject is not defined"; diff --git a/app/qml/main.qml b/app/qml/main.qml index 2442bce0a..329346a9b 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -142,6 +142,7 @@ ApplicationWindow { console.log("Application initialized!") } + //HERE MMMapController { id: map @@ -313,6 +314,9 @@ ApplicationWindow { text: qsTr("Zoom to project") iconSource: __style.zoomToProjectIcon onClicked: { + //HERE + //If gps button is true then do someting + __inputUtils.zoomToProject( __activeProject.qgsProject, map.mapSettings ) } } diff --git a/app/qml/map/MMMapController.qml b/app/qml/map/MMMapController.qml index 8f0e828e0..c1a65feac 100644 --- a/app/qml/map/MMMapController.qml +++ b/app/qml/map/MMMapController.qml @@ -34,7 +34,7 @@ Item { property bool isTrackingPosition: trackingManager?.isTrackingPosition ?? false property bool isStreaming: recordingToolsLoader.active ? recordingToolsLoader.item.recordingMapTool.recordingType === MM.RecordingMapTool.StreamMode : false property bool centeredToGPS: false - + //HERE property MM.PositionTrackingManager trackingManager: tracking.item?.manager ?? null signal featureIdentified( var pair ) @@ -738,6 +738,7 @@ Item { } } + //HERE MMMapButton { id: gpsButton From 73e966922ca2310b54143fd29bd5222b1b120307 Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Thu, 25 Apr 2024 11:11:54 -0300 Subject: [PATCH 2/4] bug-fix 3359 first version --- app/qml/main.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/qml/main.qml b/app/qml/main.qml index 329346a9b..a60fbe4eb 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -316,7 +316,7 @@ ApplicationWindow { onClicked: { //HERE //If gps button is true then do someting - + map.centeredToGPS = false __inputUtils.zoomToProject( __activeProject.qgsProject, map.mapSettings ) } } From d0e75eab300ae339e2482ed70680e53cb157f1b5 Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Thu, 25 Apr 2024 11:29:19 -0300 Subject: [PATCH 3/4] final version of bug fix --- app/qml/main.qml | 3 --- app/qml/map/MMMapController.qml | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/app/qml/main.qml b/app/qml/main.qml index a60fbe4eb..71eb4b212 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -142,7 +142,6 @@ ApplicationWindow { console.log("Application initialized!") } - //HERE MMMapController { id: map @@ -314,8 +313,6 @@ ApplicationWindow { text: qsTr("Zoom to project") iconSource: __style.zoomToProjectIcon onClicked: { - //HERE - //If gps button is true then do someting map.centeredToGPS = false __inputUtils.zoomToProject( __activeProject.qgsProject, map.mapSettings ) } diff --git a/app/qml/map/MMMapController.qml b/app/qml/map/MMMapController.qml index c1a65feac..8f0e828e0 100644 --- a/app/qml/map/MMMapController.qml +++ b/app/qml/map/MMMapController.qml @@ -34,7 +34,7 @@ Item { property bool isTrackingPosition: trackingManager?.isTrackingPosition ?? false property bool isStreaming: recordingToolsLoader.active ? recordingToolsLoader.item.recordingMapTool.recordingType === MM.RecordingMapTool.StreamMode : false property bool centeredToGPS: false - //HERE + property MM.PositionTrackingManager trackingManager: tracking.item?.manager ?? null signal featureIdentified( var pair ) @@ -738,7 +738,6 @@ Item { } } - //HERE MMMapButton { id: gpsButton From 27a93f238ca188c90968246fe9e9ec4224ea340f Mon Sep 17 00:00:00 2001 From: VitorVieiraZ Date: Thu, 25 Apr 2024 12:18:00 -0300 Subject: [PATCH 4/4] post review changes --- app/inpututils.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/inpututils.cpp b/app/inpututils.cpp index f8e5aed12..c6e26183f 100644 --- a/app/inpututils.cpp +++ b/app/inpututils.cpp @@ -1834,8 +1834,6 @@ bool InputUtils::isPointLayerFeature( const FeatureLayerPair &feature ) void InputUtils::zoomToProject( QgsProject *qgsProject, InputMapSettings *mapSettings ) { - //change gps lock status - if ( !qgsProject || !mapSettings ) { qDebug() << "Cannot zoom to extent, MapSettings or QgsProject is not defined";