<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Access a marker by one of it's component and remove it]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=984&amp;type=atom" />
	<updated>2018-12-07T19:48:56Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=984</id>
		<entry>
			<title type="html"><![CDATA[Re: Access a marker by one of it's component and remove it]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4362#p4362" />
			<content type="html"><![CDATA[<div class="codebox"><pre><code>OnlineMapsControlBase3D.instance.RemoveMarker3D((OnlineMapsMarker3D)waypoints[i].gameObject.GetComponent&lt;OnlineMapsMarker3DInstance&gt;().marker);</code></pre></div><p>It&#039;s working, thanks <img src="https://forum.infinity-code.com/img/smilies/big_smile.png" width="15" height="15" alt="big_smile" /></p>]]></content>
			<author>
				<name><![CDATA[Thibault]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=821</uri>
			</author>
			<updated>2018-12-07T19:48:56Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4362#p4362</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Access a marker by one of it's component and remove it]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4360#p4360" />
			<content type="html"><![CDATA[<p>Hello.</p><p>To remove the 3D marker, use OnlineMapsControlBase3D.RemoveMarker3D.<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBase3D.html#ac98b7909b93d611d87377e46c15d2eae">http://infinity-code.com/doxygen/online … 46c15d2eae</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-12-07T19:38:45Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4360#p4360</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Access a marker by one of it's component and remove it]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=4359#p4359" />
			<content type="html"><![CDATA[<p>Hi,</p><p>I&#039;m trying to remove some markers using OnlineMaps.RemoveMarker(OnlineMapsMarker marker)</p><p>The thing is, i don&#039;t have a reference of the marker i want to remove, but a reference of one of it&#039;s component.</p><div class="codebox"><pre><code>public Waypoint[] waypoints; //Waypoint is a c# script that is attached to a marker 3D</code></pre></div><div class="codebox"><pre><code>for (int i = 0; i &lt; waypoints.Length; i++)
        {
            //Destroy(waypoints[i].gameObject);   // FAIL -&gt; the marker is not destroyed
            map.RemoveMarker((OnlineMapsMarker)waypoints[i].gameObject.GetComponent&lt;OnlineMapsMarker3DInstance&gt;().marker); //this compile but fail while running with error : &quot;Cannot cast from source type to destination type.&quot;
        }</code></pre></div><p>I tried several different formula to remove the markers but can&#039;t find a working solution. How to remove a marker by it&#039;s instance ?</p>]]></content>
			<author>
				<name><![CDATA[Thibault]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=821</uri>
			</author>
			<updated>2018-12-07T19:15:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=4359#p4359</id>
		</entry>
</feed>
