<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Remove custom tooltips]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=379&amp;type=atom" />
	<updated>2017-01-11T22:56:34Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=379</id>
		<entry>
			<title type="html"><![CDATA[Re: Remove custom tooltips]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1671#p1671" />
			<content type="html"><![CDATA[<p>Yes. Actually, I already did it, and in future updates OnRemoveMarker will be invoked.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-01-11T22:56:34Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1671#p1671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Remove custom tooltips]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1669#p1669" />
			<content type="html"><![CDATA[<p>Okay then, thanks for the tip!</p><p>On a side note, will &quot;OnRemoveMarker&quot; be invoked when calling &quot;RemoveAllMarkers&quot; in a future update?</p>]]></content>
			<author>
				<name><![CDATA[vlucki]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=335</uri>
			</author>
			<updated>2017-01-11T15:45:15Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1669#p1669</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Remove custom tooltips]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1660#p1660" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Just remove the all tooltips before using RemoveAllMarkers.<br />Something like:<br /></p><div class="codebox"><pre><code>foreach (OnlineMapsMarker marker in OnlineMaps.instance.markers) DestroyTooltip(marker);
OnlineMaps.instance.RemoveAllMarkers();</code></pre></div><p>If you remove the markers from another script, simply make a public method that will remove all tooltips.</p><p>Thank you for writing about OnRemoveMarker. We missed this point.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-01-11T08:17:29Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1660#p1660</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Remove custom tooltips]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1657#p1657" />
			<content type="html"><![CDATA[<p>How to remove custom uGUI tooltips from the map when all markers are removed?</p><p>The example code doesn&#039;t seem to work when I call<br /></p><div class="codebox"><pre><code>OnlineMaps.instance.RemoveAllMarkers();</code></pre></div><p>because &quot;OnRemoveMarker&quot; is not called.</p><p>Also, since the array containing all markers is created anew, the code in LateUpdate doesn&#039;t work either</p><div class="codebox"><pre><code>        //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;
            }
        }</code></pre></div><p>I figured I could just call &quot;RemoveMarker&quot;, but for a lot of markers, calling Array.Resize every time is out of the question.</p><p>I also thought about just creating an extension method that calls &quot;OnRemoveMarker&quot; for every one</p><p>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)</p>]]></content>
			<author>
				<name><![CDATA[vlucki]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=335</uri>
			</author>
			<updated>2017-01-10T15:42:02Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1657#p1657</id>
		</entry>
</feed>
