summaryrefslogtreecommitdiffstats
path: root/examples/location/mapviewer/mapviewer.qml
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-02-10 18:17:11 +0100
committerMichal Klocek <michal.klocek@theqtcompany.com>2015-04-13 14:54:04 +0000
commitd9af6b61ae03a7d8e3bf3295f948bb3f2ce36d9a (patch)
treef12bf03190c112c030573e8c1a739c79ba808ecd /examples/location/mapviewer/mapviewer.qml
parentfb1395c2af753d559763f79b4d75320498f30ab5 (diff)
Replace map popup menu with qtquickcontrols based one.
Change-Id: I1ce01528f260dfb7f735c2b2ab777404a5a4a5b4 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/location/mapviewer/mapviewer.qml')
-rw-r--r--examples/location/mapviewer/mapviewer.qml28
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml
index e0751bbe..cc276f1c 100644
--- a/examples/location/mapviewer/mapviewer.qml
+++ b/examples/location/mapviewer/mapviewer.qml
@@ -305,6 +305,9 @@ ApplicationWindow {
showMessage(title,message);\
}\
}\
+ onShowMainMenu: {\
+ mapPopupMenu.show(coordinate);\
+ }\
}',page)
map.plugin = plugin;
map.zoomLevel = (map.maximumZoomLevel - map.minimumZoomLevel)/2
@@ -338,7 +341,32 @@ ApplicationWindow {
}
}
+ MapPopupMenu {
+ id: mapPopupMenu
+ onItemClicked: {
+ stackView.pop(page)
+ if (item === "addMarker") {
+ map.addMarker()
+ } else if (item === "getCoordinate") {
+ map.coordinatesCaptured(coordinate.latitude, coordinate.longitude)
+ } else if (item === "fitViewport") {
+ map.fitViewportToMapItems()
+ } else if (item === "deleteMarkers") {
+ map.deleteMarkers()
+ } else if (item === "deleteItems") {
+ map.deleteMapItems()
+ }
+ }
+ function show(coordinate) {
+ stackView.pop(page)
+ mapPopupMenu.coordinate = coordinate
+ mapPopupMenu.markersCount = map.markers.length
+ mapPopupMenu.mapItemsCount = map.mapItems.length
+ mapPopupMenu.update()
+ mapPopupMenu.popup()
+ }
+ }
StackView {
id: stackView