Closed AnthonyLatty closed 5 years ago
Sorry I can not understand you want.
Xamarin.Forms.GoogleMaps has Pin.IsVisible property. This means, You can control to Pin show/hide.
No Pin.IsVisible is not what i want.
What i would like to know is if the library supports clicking on a particular pin and raising an event for that pin. For example if i have 3 Pins being shown on a map, i would like the user to click on the first pin and that pin raises an event. If the user clicks on the Second Pin that should raise a different event.
You can use Map.PinClicked event.
map.PinClicked += (sender, e) =>
{
if (Object.ReferenceEquals(e.Pin, pin1))
{
Debug.WriteLine("you clicked pin1");
}
else if (Object.ReferenceEquals(e.Pin, pin2))
{
Debug.WriteLine("you clicked pin2");
}
else if (Object.ReferenceEquals(e.Pin, pin3))
{
Debug.WriteLine("you clicked pin3");
}
}
Works as expected..
I was wondering if it is possible to display a specific pin when its clicked. For example: When all the pins are loaded can i have a DisplayAlert attached to a specific pin? that way when that pin is clicked it will show it only for that particular pin?