fivenine-zurich/UnifiedMaps

Delete pins from the map

Closed this issue · 2 comments

Good evening, I have the doubt of how to implement a deletion of the pins on the map. I currently do a search that shows me several pins on the map, but if I do a new search, the previous pins are not deleted, as I can clean a list of type LinkedList so that the map erases the pins showed and put only the new ones, without refreshing the screen.

Greetings.

Hi,

You mentioned that you are using a LinkeList. Is this bound to UnifiedMaps in Xaml? If so, the type of the list should be an ObservableCollection. Because otherwise UnifiedMaps will not get notified on clearing or adding new markers.

As you say, the correct way to connect a list of pins to the map is to create an ObservableCollection, in this way we can make a clear () and add new pins and the map will know immediately.

Thank you very much