diff options
author | Michal Klocek <michal.klocek@theqtcompany.com> | 2015-02-11 19:03:23 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@theqtcompany.com> | 2015-04-13 14:54:41 +0000 |
commit | 5b26a3607f7609f798bd40b4ed475c9e4bc6175d (patch) | |
tree | d1a9dbe879179832625811664076e51535c68a45 /examples/location/mapviewer/mapviewer.qml | |
parent | 19d8a8514ae875b0fc4b5e7e7a08b5db74a457ce (diff) |
Replace route information list in mapviewer example.
Old implementation is hard to use with touch devices,
since it requires drag from left edge of screen to
see the route information. Show route info from item's
menu instead. Use qtquickcontrols.
Change-Id: I8dc73d13a9e2ed0b7730f1ecbde413f22e1c897b
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/location/mapviewer/mapviewer.qml')
-rw-r--r-- | examples/location/mapviewer/mapviewer.qml | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml index 1472b77f..64de94be 100644 --- a/examples/location/mapviewer/mapviewer.qml +++ b/examples/location/mapviewer/mapviewer.qml @@ -188,7 +188,6 @@ ApplicationWindow { map.routeModel.update(); // center the map on the start coord map.center = startCoordinate; - stackView.pop(page); //! [routerequest1] } @@ -222,6 +221,14 @@ ApplicationWindow { stackView.pop(page) } + function showRouteListPage() { + stackView.push({ item: Qt.resolvedUrl("RouteList.qml") , + properties: { + "routeModel" : map.routeModel + }}) + stackView.currentItem.closeForm.connect(closeForm) + } + function geocodeMessage(){ var street, district, city, county, state, countryCode, country, postalCode, latitude, longitude, text latitude = Math.round(map.geocodeModel.get(0).coordinate.latitude * 10000) / 10000 @@ -315,6 +322,9 @@ ApplicationWindow { onShowPointMenu: {\ itemPopupMenu.show("Point",coordinate);\ }\ + onShowRouteList: {\ + showRouteListPage(); + }\ }',page) map.plugin = plugin; map.zoomLevel = (map.maximumZoomLevel - map.minimumZoomLevel)/2 @@ -457,13 +467,13 @@ ApplicationWindow { onItemClicked: { stackView.pop(page) switch (item) { - case "infoRoute": - //ignore till next commit + case "showRouteInfo": + showRouteListPage() break; case "deleteRoute": - map.clearRoute() + map.routeModel.reset(); break; - case "infoPoint": + case "showPointInfo": map.showGeocodeInfo() break; case "deletePoint": |