[FIXED] How to update pins in xamarin forms maps?


I have the following code:

private async void setHelpersPins(object sender, ElapsedEventArgs e)
    var temp = await firebaseHelper.GetAllHelperUsers();

    if (map.Pins.Count>0)

    foreach (var user in temp)
        Pin pin = new Pin
            Label = user.Nickname,
            Address = "További információkért kattints ide.",
            Type = PinType.Place,
            Position = new Position(user.Latitude, user.Longitude)

It runs every 10second by using Timer.Elapsed.

But it makes the map blinks every time this method runs, which is not great for me.

How can I only update those pin coordinates, where the user’s nicknames are the same?


to find the elements of a collection, use a LINQ query

using System.Linq;


var pins = map.Pins.Where(x => x.Label == "somevalue").ToList();

then you can iterate over the list to update it

foreach (var p in pins)
  p.Position = someNewPosition;

Answered By – Jason

Answer Checked By – Senaida (Easybugfix Volunteer)

Leave a Reply

(*) Required, Your email will not be published