简体   繁体   中英

how to trigger pin clicked event from a collection view in Xamarin forms

I am trying to display members in a collection view and I also have a map (using google maps) which shows each member location. I want to highlight the pin on the map when a user selects a member in the collection view. any idea.

thanks in advance

If you're using the xamarin.forms.googlemaps then you can use this to programmatically select the pin in code:

map.SelectedPin = yourPin;

So the process would be: After tapping in the collection view, navigate to the map with an id which is tagged in your pin. Then you can go through the pins and check which has the same id tagged and set it as your selected Pin.

You can find more info here about selecting the pin in code:

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM