summaryrefslogtreecommitdiffstats
path: root/examples/location/mapviewer/mapviewer.qml
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-02-11 19:03:23 +0100
committerMichal Klocek <michal.klocek@theqtcompany.com>2015-04-13 14:54:36 +0000
commit19d8a8514ae875b0fc4b5e7e7a08b5db74a457ce (patch)
tree7a2c41806934a89baf365006c346cd172c9c0c65 /examples/location/mapviewer/mapviewer.qml
parent6cd56cd2a431238f67544f62fd541c55ba9ecda1 (diff)
Replace route and point menus in mapviewer example.
Use qtquickcontroles based one. Change-Id: I02f657cbb2b3f2728edd3287b0d7edf793c20aa7 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/location/mapviewer/mapviewer.qml')
-rw-r--r--examples/location/mapviewer/mapviewer.qml42
1 files changed, 39 insertions, 3 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml
index e2b41611..1472b77f 100644
--- a/examples/location/mapviewer/mapviewer.qml
+++ b/examples/location/mapviewer/mapviewer.qml
@@ -293,9 +293,6 @@ ApplicationWindow {
onShowGeocodeInfo:{\
showMessage(qsTr("Location"),geocodeMessage(),page);\
}\
- onResetState: {\
- page.state = "";\
- }\
onErrorChanged: {\
if (map.error != Map.NoError) {\
var title = qsTr("ProviderError");\
@@ -312,6 +309,12 @@ ApplicationWindow {
onShowMarkerMenu: {\
markerPopupMenu.show(coordinate);\
}\
+ onShowRouteMenu: {\
+ itemPopupMenu.show("Route",coordinate);\
+ }\
+ onShowPointMenu: {\
+ itemPopupMenu.show("Point",coordinate);\
+ }\
}',page)
map.plugin = plugin;
map.zoomLevel = (map.maximumZoomLevel - map.minimumZoomLevel)/2
@@ -440,6 +443,39 @@ ApplicationWindow {
}
+ ItemPopupMenu {
+
+ id: itemPopupMenu
+
+ function show(type,coordinate) {
+ stackView.pop(page)
+ itemPopupMenu.type = type
+ itemPopupMenu.update()
+ itemPopupMenu.popup()
+ }
+
+ onItemClicked: {
+ stackView.pop(page)
+ switch (item) {
+ case "infoRoute":
+ //ignore till next commit
+ break;
+ case "deleteRoute":
+ map.clearRoute()
+ break;
+ case "infoPoint":
+ map.showGeocodeInfo()
+ break;
+ case "deletePoint":
+ map.geocodeModel.reset()
+ break;
+ default:
+ console.log("Unsupported operation")
+ }
+ }
+
+ }
+
StackView {
id: stackView