diff options
Diffstat (limited to 'mobile-widgets/qml/MapWidget.qml')
-rw-r--r-- | mobile-widgets/qml/MapWidget.qml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index b07858c3a..4794533be 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -114,6 +114,8 @@ Item { function doubleClickHandler(coord) { newCenter = coord newZoom = zoomLevel + zoomStep + if (newZoom > maximumZoomLevel) + newZoom = maximumZoomLevel mapAnimationClick.restart() } @@ -167,6 +169,56 @@ Item { } } + Image { + id: imageZoomIn + x: 10 + (toggleImage.width - imageZoomIn.width) * 0.5; y: toggleImage.y + toggleImage.height + 10 + source: "qrc:///mapwidget-zoom-in" + SequentialAnimation { + id: imageZoomInAnimation + PropertyAnimation { + target: imageZoomIn; property: "scale"; from: 1.0; to: 0.8; duration: 120 + } + PropertyAnimation { + target: imageZoomIn; property: "scale"; from: 0.8; to: 1.0; duration: 80 + } + } + MouseArea { + anchors.fill: parent + onClicked: { + map.newCenter = map.center + map.newZoom = map.zoomLevel + map.zoomStep + if (map.newZoom > map.maximumZoomLevel) + map.newZoom = map.maximumZoomLevel + mapAnimationClick.restart() + imageZoomInAnimation.restart() + } + } + } + + Image { + id: imageZoomOut + x: imageZoomIn.x; y: imageZoomIn.y + imageZoomIn.height + 10 + source: "qrc:///mapwidget-zoom-out" + SequentialAnimation { + id: imageZoomOutAnimation + PropertyAnimation { + target: imageZoomOut; property: "scale"; from: 1.0; to: 0.8; duration: 120 + } + PropertyAnimation { + target: imageZoomOut; property: "scale"; from: 0.8; to: 1.0; duration: 80 + } + } + MouseArea { + anchors.fill: parent + onClicked: { + map.newCenter = map.center + map.newZoom = map.zoomLevel - map.zoomStep + mapAnimationClick.restart() + imageZoomOutAnimation.restart() + } + } + } + function openLocationInGoogleMaps(latitude, longitude) { var loc = latitude + " " + longitude var url = "https://www.google.com/maps/place/" + loc + "/@" + loc + ",5000m/data=!3m1!1e3!4m2!3m1!1s0x0:0x0" |