Reputation: 690
I'm building a Xamarin Android app, I have a list of LatLng position and I want to move my marker every second, at each position of my list...
Do you have any idea of how to implement that ? Thank you
Upvotes: 1
Views: 57
Reputation: 48
First of all create a Timer =>
timer = new Timer();
timer.Interval = 200;
timer.Enabled = true;
timer.Elapsed += OnMarkerMoving;
timer.Start();
And in your OnMarkerMoving method =>
public void OnMarkerMoving()
{
count++
if(count < positionList.Count)
{
yourMarker.Position = positionList[count];
} else
timer.Dispose();
}
Upvotes: 3