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:27 +0000
commit6cd56cd2a431238f67544f62fd541c55ba9ecda1 (patch)
treede1f503d18184c9730bc03f464f6d52e94e45e0b /examples/location/mapviewer/mapviewer.qml
parent8bd7914a78ec6f29ecb52995b0c0116f34d7a2d2 (diff)
Replace item draw menu in mapviewer example.
Use qtquickcontroles based one. Change-Id: I7d915e3c687ab46d8390681a12c4009043016092 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'examples/location/mapviewer/mapviewer.qml')
-rw-r--r--examples/location/mapviewer/mapviewer.qml36
1 files changed, 29 insertions, 7 deletions
diff --git a/examples/location/mapviewer/mapviewer.qml b/examples/location/mapviewer/mapviewer.qml
index ba906e85..e2b41611 100644
--- a/examples/location/mapviewer/mapviewer.qml
+++ b/examples/location/mapviewer/mapviewer.qml
@@ -376,21 +376,43 @@ ApplicationWindow {
id: markerPopupMenu
onItemClicked: {
stackView.pop(page)
- if (item === "deleteMarker") {
+ switch (item) {
+ case "deleteMarker":
map.deleteMarker(map.currentMarker)
- } else if (item === "getMarkerCoordinate") {
+ break;
+ case "getMarkerCoordinate":
map.coordinatesCaptured(map.markers[map.currentMarker].coordinate.latitude, map.markers[map.currentMarker].coordinate.longitude)
- } else if (item === "moveMarkerTo") {
+ break;
+ case "moveMarkerTo":
askForCoordinate()
- } else if (item === "showDrawMenu") {
- map.drawItemPopup()
- } else if (item === "routeToNextPoint" || item === "routeToNextPoints") {
+ break;
+ case "routeToNextPoint":
+ case "routeToNextPoints":
map.calculateRoute()
- } else if (item === "distanceToNextPoint") {
+ break
+ case "distanceToNextPoint":
var coordinate1 = map.markers[currentMarker].coordinate;
var coordinate2 = map.markers[currentMarker+1].coordinate;
var distance = map.formatDistance(coordinate1.distanceTo(coordinate2));
showMessage(qsTr("Distance"),"<b>" + qsTr("Distance:") + "</b> " + distance)
+ break
+ case "drawImage":
+ map.addGeoItem("ImageItem")
+ break
+ case "drawRectangle":
+ map.addGeoItem("RectangleItem")
+ break
+ case "drawCircle":
+ map.addGeoItem("CircleItem")
+ break;
+ case "drawPolyline":
+ map.addGeoItem("PolylineItem")
+ break;
+ case "drawPolygonMenu":
+ map.addGeoItem("PolygonItem")
+ break
+ default:
+ console.log("Unsupported operation")
}
}