Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Animated annotations #4402

Closed
tobrun opened this issue Mar 21, 2016 · 7 comments
Closed

Animated annotations #4402

tobrun opened this issue Mar 21, 2016 · 7 comments
Labels

Comments

@tobrun
Copy link
Member

tobrun commented Mar 21, 2016

Background info

The possibility to change a marker LatLng landed in master with d742c2d. A typical use-case users have been reporting is having a ride sharing app that shows cars driving around on the map. I tried implementing this on the java side using Android SDK animations (code). This works for 1-2 markers but is not performant. Each animation update will set a new position to the Marker and will have to go through JNI to update it. Without analysing it with some tools, I'm guessing that the overhead associated with JNI is causing the performance problem.

Feature request

Suggested solution is to allow having a moveToLatLng method on PointAnnotation in core. This will calculate and update an annotation position until it reaches the destination. From binding perspective we just pass of the information to core and core handles updating the position.

Other approaches

Note that we have been thinking about other approaches to this problem. Until now we have always indicated that animations is something that should be done through the native animation framework of the bindings using the native views from that binding. This approach is ticketed in for Android in #3276. This would also use jni in the process and will probably not scale very well. This approach could benefit from #4384 that would limit the round tripping currently needed.

@leye0
Copy link

leye0 commented Apr 6, 2016

@tobrun Do you know (how can I see) if this feature has been associated with an upcoming version?

And out of curiosity, is there already something like an interpolation timer or an animation API in the native part of Mapbox?

@tobrun
Copy link
Member Author

tobrun commented Apr 6, 2016

@leye0
Currently this is not on our GL core roadmap.
I just personally added this request since I feel this would make a useful feature.

@leye0
Copy link

leye0 commented Apr 6, 2016

Thanks!

@zugaldia
Copy link
Member

/sub

@jfirebaugh jfirebaugh changed the title Add moveToLatLng PointAnnotation method Animated annotations Jun 14, 2016
@jfirebaugh
Copy link
Contributor

Core now has Map#updateAnnotation, which allows any property of any annotation type to be updated. We should implement animations at the SDK level using Map#updateAnnotation as the primitive, and see what performance is like.

@tobrun
Copy link
Member Author

tobrun commented Jun 15, 2016

@jfirebaugh we are running with this approach in #5299. Next steps is to profile and see why updateAnnotation are slow for us. Another approach to solving this is into animating the ViewMarker as an overlay using Android SDK animations and only cal updateAnnotation when we end the Android SDK animation.

@jfirebaugh
Copy link
Contributor

We optimized annotation animation in #5385.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants