Topic: Remove custom tooltips
How to remove custom uGUI tooltips from the map when all markers are removed?
The example code doesn't seem to work when I call
OnlineMaps.instance.RemoveAllMarkers();because "OnRemoveMarker" is not called.
Also, since the array containing all markers is created anew, the code in LateUpdate doesn't work either
//empty, so no tooltip is destroyed
foreach (OnlineMapsMarker marker in OnlineMaps.instance.markers)
{
if (string.IsNullOrEmpty(marker.label))
{
DestroyTooltip(marker);
continue;
}
if (!marker.inMapView)
{
DestroyTooltip(marker);
continue;
}
}I figured I could just call "RemoveMarker", but for a lot of markers, calling Array.Resize every time is out of the question.
I also thought about just creating an extension method that calls "OnRemoveMarker" for every one
Bottom line, is there a way to clear all markers from the map and, at the same time, remove all custom tooltips? Is there an event somewhere that is called? Or is this something I have to implement by myself? (which is fine, btw, I am just curious)