Topic: Best way to find index of markers?

I keep finding myself needing to write a lot of code to simply to remove specific markers from the map.

My current goto is to simply blow away all of the markers and redraw the ones I still want.

I'm surprised that there isn't a `FindIndex` for the OnlineMapsMarkerManager class.

Maybe I'm missing something, what is the preferred method of removing a specific marker from the map?

Re: Best way to find index of markers?


How to find the index of a marker:

int index = OnlineMapsMarkerManager.instance.items.IndexOf(marker);

How to remove a specific marker:
OnlineMapsInteractiveElementManager.RemoveItem … 3dc76b6b3b


How to remove all markers except the required one(s):
OnlineMapsInteractiveElementManager.RemoveAllItems … 8d6c977d19

OnlineMapsMarkerManager.RemoveAllItems(m => m != marker);
Kind Regards,
Infinity Code Team.

uContext is Editor PowerPack (more than 40 tools) that take your workflow in Unity Editor to a next level, simplifies working with content, adds new features, corrects and improves the editor’s built-in behaviors. Click here to download uContext Basic for free.

Re: Best way to find index of markers?

Thanks, I think I had it in my mind that I should have been able to access the IndexOf<Marker> right from the OnlineMapsMarkerManager class, since that is where the RemoveItem is.

Anywho, thank you!