-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Animated annotations #4402
Comments
@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? |
@leye0 |
Thanks! |
/sub |
Core now has |
@jfirebaugh we are running with this approach in #5299. Next steps is to profile and see why |
We optimized annotation animation in #5385. |
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.
The text was updated successfully, but these errors were encountered: