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?

Hello.

How to find the index of a marker:

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

How to remove a specific marker:
OnlineMapsInteractiveElementManager.RemoveItem
https://infinity-code.com/doxygen/onlin … 3dc76b6b3b

OnlineMapsMarkerManager.RemoveItem(marker);

How to remove all markers except the required one(s):
OnlineMapsInteractiveElementManager.RemoveAllItems
https://infinity-code.com/doxygen/onlin … 8d6c977d19

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

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

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!