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

Add multiple markers and rotations to AnimatedMarkerActivity #5299

Closed
zugaldia opened this issue Jun 9, 2016 · 9 comments
Closed

Add multiple markers and rotations to AnimatedMarkerActivity #5299

zugaldia opened this issue Jun 9, 2016 · 9 comments
Labels
Android Mapbox Maps SDK for Android annotations Annotations on iOS and macOS or markers on Android

Comments

@zugaldia
Copy link
Member

zugaldia commented Jun 9, 2016

As mentioned in #5242 we currently have an experimental AnimatedMarkerActivity in the TestApp that animates a marker position using a ValueAnimator. We want to expand this activity to reflect common scenarios (e.g. a car marker), and create a concrete example that can help us profile the performance of different marker animations approaches.

In particular, we want to add the following elements:

Related sample in the same category: #5282.

/cc: @ivovandongen @tobrun @bleege @cammace

@zugaldia
Copy link
Member Author

zugaldia commented Jun 9, 2016

Follow progress in https://github.com/mapbox/mapbox-gl-native/tree/5299-sample-cars-driving branched out from release-android-v4.1.0.

@zugaldia zugaldia added Android Mapbox Maps SDK for Android annotations Annotations on iOS and macOS or markers on Android labels Jun 9, 2016
@zugaldia zugaldia added this to the android-v4.1.0 milestone Jun 9, 2016
@ivovandongen
Copy link
Contributor

ivovandongen commented Jun 10, 2016

I've been trying some different combinations. Using both Markers and MarkerViews. All using ValueAnimators to move around the Markers. As expected, the results are not as smooth as we'd like. (This is all on a Nexus 5X)

First off the MarkerViews

One car:
1car mp4
Same thing, with gpu/cpu overlays
1car-debug mp4

10 cars
10cars mp4
10 cars, with gpu/cpu overlays
10cars-debug mp4

@ivovandongen
Copy link
Contributor

Next up: the markers (GL).

1 car
1car-gl_marker mp4
1 car, debug
1car-gl_marker-debug mp4

10 cars
10cars-gl_marker mp4
10 cars, debug
10cars_gl_marker-debug mp4

Results are very similar with to Android based View Markers.

@ivovandongen
Copy link
Contributor

Every step in the animation results in the following log statements btw:

06-10 16:26:05.732 19469-19469/com.mapbox.mapboxsdk.testapp D/mbgl: [JNI]: nativeUpdateMarker
06-10 16:26:05.780 19469-19469/com.mapbox.mapboxsdk.testapp D/mbgl: [Android]: NativeMapView::invalidate()
06-10 16:26:05.784 19469-19469/com.mapbox.mapboxsdk.testapp D/mbgl: [Android]: NativeMapView::invalidate()
06-10 16:26:05.785 19469-19469/com.mapbox.mapboxsdk.testapp D/mbgl: [Android]: NativeMapView::invalidate()

Although not much needs to be done on the core side (mainly, calculating screen position from the new coordinates), it seems that a lot happens anyways.

ivovandongen added a commit that referenced this issue Jun 10, 2016
…ent on distance. Use non-linear interpolator.
@zugaldia
Copy link
Member Author

Great job @ivovandongen , this is great progress.

Did you notice if any of the following had any lower/higher noticeable performance impact?

@tobrun
Copy link
Member

tobrun commented Jun 13, 2016

I'm going to run with this branch and try out proposed solution for this from #5242.

tobrun pushed a commit that referenced this issue Jun 17, 2016
…ent on distance. Use non-linear interpolator.
tobrun pushed a commit that referenced this issue Jun 17, 2016
@tobrun
Copy link
Member

tobrun commented Jun 17, 2016

Merged with #5300 on release-android-v4.1.0

@AlejandroP27
Copy link

Hello, I am very glad that I am a super rookie on the subject of Android, serious layers of telling me or explaining how you did to give movements to multiple markes if it is not much trouble. thank you very much

@zugaldia
Copy link
Member Author

zugaldia commented Jan 2, 2020

Hi @AlejandroP27, thanks for using our Maps SDK. However, this is not a support forum — if you have more implementation questions, please check out our excellent help docs or post your question on Stack Overflow. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android annotations Annotations on iOS and macOS or markers on Android
Projects
None yet
Development

No branches or pull requests

4 participants