From 8487873029638ba8b994e93e62ab9676b6b064d5 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 20 Jul 2017 03:07:47 +0300 Subject: mapwidget.qml: add an small icon (top-left) to toggle the map type Clicking the image toggles the map.activeMapType value from type STREET to type SATELLITE. Signed-off-by: Lubomir I. Ivanov --- mobile-widgets/qml/MapWidget.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index 163579e7e..736f7bc7d 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -112,5 +112,16 @@ Item { mapHelper.model.selectedUuid = 0 animateMapZoomOut() } + + Image { + x: 10; y: x + source: "qrc:///mapwidget-toggle-" + (map.activeMapType === map.mapType.SATELLITE ? "street" : "satellite") + MouseArea { + anchors.fill: parent + onClicked: { + map.activeMapType = map.activeMapType === map.mapType.SATELLITE ? map.mapType.STREET : map.mapType.SATELLITE + } + } + } } } -- cgit v1.2.3-70-g09d2