diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2017-07-20 03:07:47 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-07-28 07:31:11 -0700 |
commit | 8487873029638ba8b994e93e62ab9676b6b064d5 (patch) | |
tree | cbbd9da9b69433cc2d6f60f31918fa9838c1684e /mobile-widgets/qml/MapWidget.qml | |
parent | 468f3b57c0a8a4b18a084822b3926ba7b6128a31 (diff) | |
download | subsurface-8487873029638ba8b994e93e62ab9676b6b064d5.tar.gz |
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 <neolit123@gmail.com>
Diffstat (limited to 'mobile-widgets/qml/MapWidget.qml')
-rw-r--r-- | mobile-widgets/qml/MapWidget.qml | 11 |
1 files changed, 11 insertions, 0 deletions
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 + } + } + } } } |