mapbox-maps-android
mapbox-maps-android copied to clipboard
Marker animation slows down
Environment
- Android OS version: 10
- Devices affected: Huawei P40 lite
- Maps SDK Version: 10.1.0
Observed behavior and steps to reproduce
Slowing down the animation can be seen on the official example https://github.com/mapbox/mapbox-maps-android/blob/android-v10.1.0/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/AnimatedMarkerActivity.kt
But for convenience, I made Style.LIGHT, LinearInterpolator and duration = 3500 for ValueAnimator and changed the marker size using the iconSize method.
In this simple example, slowdowns are not always reproduced, but often. In more complex examples (in a commercial application), slowdowns are visible on all devices, even quite powerful ones. For the 9th version of the mapbox, the slowdowns were noticeable only for very cheap android models.
Expected behavior
Marker animation without slows down
Notes / preliminary analysis
Additional links and references
https://github.com/mapbox/mapbox-maps-android/blob/android-v10.1.0/app/src/main/java/com/mapbox/maps/testapp/examples/markersandcallouts/AnimatedMarkerActivity.kt
https://user-images.githubusercontent.com/57287061/145818247-4bbf3d23-342f-47e6-a181-eb6324d130b3.mp4
@Copatych are you able to reproduce these slowdowns in v10.2.0?
@ZiZasaurus Yes, I am able to reproduce these slowdowns in v10.2.0.
@Copatych, thank you for this. When you mention that the animation slows down do you mean that the speed with which the marker moves is not uniform?
@ZiZasaurus. Probably not. The speed remains constant, but the marker sometimes goes smoothly, sometimes teleports. That is, for the same period of time, the marker can be redrawn in a new position, for example, 2 times or 10 times.
Maybe this video shows better.
https://user-images.githubusercontent.com/57287061/148635163-8fcba7da-eb6e-4e7f-8441-dbf909455984.mp4
@Copatych, can you provide some information on your use case for the animated markers?
@ZiZasaurus. As I said, this problem is reproduced on the official example. The last time it was well reproduced, if I animate the marker on top of the city (perhaps there is a correlation with the displayed text, for example, in the city all streets are signed, parks are signed).
This problem was noticed in the following use case. There is a ski resort for which its border is displayed as a solid line. There are lifts, which are imaged by a dot line. There are signatures for the lifts. There is an animation of one marker with the image of the cabin on top of one line of the lift. LinearInterpolator is used. During animation, the camera shows only marker and a part of one lift, all the others do not fall into view. For certainty, let the number of lifts be 4.