I'm trying to understand how to animate markers when using mapbox-gl
. I'm actually using the Xamarin
binding of the 3.2.0.3 java library, so the problem might be there.
I'm using the examples that we can find on the GitHub page, and mainly this example. This example shows that a simple ValueAnimator
modifying the Position of the MarkerOptions object is enough to achieve a movement.
All my attempts to move a marker failed: applying SetPosition on a MarkerOptions object has no effect.
I've tried temporary solutions, like removing all the markers and re-add them. Either in an animator or by making my own logic in the Update event. But of course, markers are flickering because modifications to the map are not perfectly sync'ed with the thread UI.
When reading the mapbox-gl
source-code samples on the project page, it seems clear to me that using Animator
on MarkerOptions is a good practice, but it just seems to fail no matter what I'm trying to do.
Summary: Invoking _myMarkerOptions.SetPosition(new LatLng(10, 10));
on an existing marker just has no effect.