diff options
-rw-r--r-- | mobile-widgets/qml/MapWidget.qml | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/mobile-widgets/qml/MapWidget.qml b/mobile-widgets/qml/MapWidget.qml index 06280bbbf..362c0c3af 100644 --- a/mobile-widgets/qml/MapWidget.qml +++ b/mobile-widgets/qml/MapWidget.qml @@ -23,13 +23,34 @@ Item { plugin: mapPlugin zoomLevel: 1 + property var newCenter: QtPositioning.coordinate(0, 0); + Component.onCompleted: { map.activeMapType = map.supportedMapTypes[esriMapTypeIndexes.SATELLITE]; } + ParallelAnimation { + id: mapAnimation + + CoordinateAnimation { + target: map + property: "center" + to: map.newCenter + duration: 2000 + } + NumberAnimation { + target: map + property: "zoomLevel" + to: 17 + duration: 3000 + easing.type: Easing.InCubic + } + } + function centerOnCoordinates(latitude, longitude) { - map.center = QtPositioning.coordinate(latitude, longitude); - map.zoomLevel = map.maximumZoomLevel * 0.9; + map.newCenter = QtPositioning.coordinate(latitude, longitude); + map.zoomLevel = 2; + mapAnimation.restart(); } } } |