Skip to content

Commit

Permalink
Reset feature geometry when starting a new tracking session (fixes #5234
Browse files Browse the repository at this point in the history
)
  • Loading branch information
nirvn committed May 11, 2024
1 parent 4f1c55a commit 5ffae02
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/qml/TrackerSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Popup {
trackerSettings.focus = true
} else {
featureModel.resetAttributes()
featureModel.applyGeometry()
tracker.feature = featureModel.feature

if (embeddedAttributeFormModel.rowCount() > 0 && !featureModel.suppressFeatureForm()) {
Expand All @@ -45,6 +46,7 @@ Popup {
projectInfo.saveTracker(featureModel.currentLayer)
}
}
tracker = undefined
}
}
}
Expand Down Expand Up @@ -485,6 +487,7 @@ Popup {
onClicked: {
applySettings()
featureModel.resetAttributes()
featureModel.applyGeometry()
tracker.feature = featureModel.feature
if (embeddedAttributeFormModel.rowCount() > 0 && !featureModel.suppressFeatureForm()) {
embeddedFeatureForm.active = true
Expand All @@ -494,6 +497,7 @@ Popup {
if (featureModel.currentLayer.geometryType === Qgis.GeometryType.Point) {
projectInfo.saveTracker(featureModel.currentLayer)
}
tracker = undefined
trackerSettings.close()
}
}
Expand Down Expand Up @@ -526,11 +530,7 @@ Popup {
id: featureModel
project: qgisProject

geometry: Geometry {
id: featureModelGeometry
rubberbandModel: rubberbandModel
vectorLayer: featureModel.currentLayer
}
geometry: Geometry {}

positionInformation: coordinateLocator.positionInformation
positionLocked: true
Expand Down Expand Up @@ -590,6 +590,7 @@ Popup {
if (featureModel.currentLayer.geometryType === Qgis.GeometryType.Point) {
projectInfo.saveTracker(featureModel.currentLayer)
}
tracker = undefined
trackerSettings.close()
}

Expand All @@ -598,6 +599,7 @@ Popup {
embeddedFeatureForm.active = false
embeddedFeatureForm.focus = false
trackingModel.stopTracker(tracker.vectorLayer)
tracker = undefined
trackerSettings.close()
}
}
Expand Down

0 comments on commit 5ffae02

Please sign in to comment.