diff options
Diffstat (limited to 'mobile-widgets/qml/MapWidget.qml')
-rw-r--r-- | mobile-widgets/qml/MapWidget.qml | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index 17b93c773..83ed48c4a 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -25,6 +25,7 @@ Item { readonly property var defaultCenter: QtPositioning.coordinate(0, 0) readonly property var defaultZoomIn: 17.0 + readonly property var defaultZoomOut: 2.0 property var newCenter: defaultCenter property var newZoom: 1.0 @@ -86,11 +87,15 @@ Item { } } - function centerOnMapLocation(mapLocation) { - map.newCenter = mapLocation.coordinate - map.zoomLevel = 2 - map.newZoom = map.defaultZoomIn + function animateMapTo(coord, zoom) { + map.newCenter = coord + map.newZoom = zoom mapAnimation.restart() + } + + function centerOnMapLocation(mapLocation) { + map.zoomLevel = map.defaultZoomOut + animateMapTo(mapLocation.coordinate, map.defaultZoomIn); mapHelper.model.selectedUuid = mapLocation.uuid } } |