LocationChooser: Add a "Re-center" action to find the pinned location

It's somewhat easy to scroll or pan away from the pin you placed, so
let's add an action to re-center the map if you want to find it again.
This commit is contained in:
Joshua Goins
2024-09-01 12:40:44 -04:00
parent 2b374a8bec
commit 4f4b10e0b6

View File

@@ -30,6 +30,12 @@ Components.AbstractMaximizeComponent {
root.close();
}
enabled: !!root.location
},
Kirigami.Action {
text: i18nc("@action:intoolbar Re-center the map onto the set location", "Re-Center")
icon.name: "snap-bounding-box-center-symbolic"
onTriggered: mapView.map.fitViewportToMapItems([mapView.locationMapItem])
enabled: root.location !== undefined
}
]