aboutsummaryrefslogtreecommitdiffstats
path: root/examples/location/mapviewer/MapViewer/forms/ReverseGeocode.qml
diff options
context:
space:
mode:
Diffstat (limited to 'examples/location/mapviewer/MapViewer/forms/ReverseGeocode.qml')
-rw-r--r--examples/location/mapviewer/MapViewer/forms/ReverseGeocode.qml38
1 files changed, 38 insertions, 0 deletions
diff --git a/examples/location/mapviewer/MapViewer/forms/ReverseGeocode.qml b/examples/location/mapviewer/MapViewer/forms/ReverseGeocode.qml
new file mode 100644
index 000000000..31122a2e9
--- /dev/null
+++ b/examples/location/mapviewer/MapViewer/forms/ReverseGeocode.qml
@@ -0,0 +1,38 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+import QtQuick
+import QtPositioning
+
+//Reverse Geocode Dialog
+ReverseGeocodeForm {
+ property string title;
+ property variant coordinate
+ signal showPlace(variant coordinate)
+ signal closeForm()
+
+ goButton.onClicked: {
+ var coordinate = QtPositioning.coordinate(parseFloat(latitude.text),
+ parseFloat(longitude.text));
+ if (coordinate.isValid) {
+ showPlace(coordinate)
+ }
+ }
+
+ clearButton.onClicked: {
+ latitude.text = ""
+ longitude.text = ""
+ }
+
+ cancelButton.onClicked: {
+ closeForm()
+ }
+
+ Component.onCompleted: {
+ latitude.text = "" + coordinate.latitude
+ longitude.text = "" + coordinate.longitude
+ if (title.length != 0) {
+ tabTitle.text = title;
+ }
+ }
+}