mapwidget.qml: make pan and zoom-in have the same duration

There was a problem with the current different duration
for pan and zoom. Ideally the pan should before the zoom:
Map zooms out -> pan to new center starts -> zoom in

The problem with this is that if the map pans out too much it
loses it's center and the above scheme would not work.

To solve the problem, make the duration of pan and zoom
the same this is not idea, but prevents the case where
the map would not zoom-in at the correct center.

Also remove the easing function.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2017-11-27 16:09:49 +02:00
parent f39e900186
commit 1bc91bfb67

View file

@ -104,9 +104,9 @@ Item {
target: map; property: "zoomLevel"; to: map.newZoomOut; duration: Math.abs(map.newZoomOut - map.zoomLevel) * 200
}
ParallelAnimation {
CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 1000 }
CoordinateAnimation { target: map; property: "center"; to: map.newCenter; duration: 2000; easing.type: Easing.OutCubic }
NumberAnimation {
target: map; property: "zoomLevel"; to: map.newZoom ; duration: 2000; easing.type: Easing.InCubic
target: map; property: "zoomLevel"; to: map.newZoom; duration: 2000
}
}
}