<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — markerClick with labels]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1848&amp;type=atom" />
	<updated>2021-09-26T12:55:10Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1848</id>
		<entry>
			<title type="html"><![CDATA[Re: markerClick with labels]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7771#p7771" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>Something like that:<br /></p><div class="codebox"><pre><code>// Set label
marker.label = &quot;My Label&quot;;

// Set tag
marker.tags.Add(&quot;My Tag&quot;);

// Set custom data
marker[&quot;anyKey&quot;] = anyValue;

// Get marker by label
marker = OnlineMapsMarkerManager.instance.FirstOrDefault(m =&gt; m.label == &quot;My Label&quot;);

// Get marker by tag
marker = OnlineMapsMarkerManager.instance.FirstOrDefault(m =&gt; m.tags.Contains(&quot;My Tag&quot;));

// Get custom data
anyValue = marker[&quot;anyKey&quot;] as TypeOfValue;</code></pre></div></blockquote></div><p>Thank you! Thats very helpful.</p>]]></content>
			<author>
				<name><![CDATA[landl0s]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1455</uri>
			</author>
			<updated>2021-09-26T12:55:10Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7771#p7771</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: markerClick with labels]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7770#p7770" />
			<content type="html"><![CDATA[<p>Something like that:<br /></p><div class="codebox"><pre><code>// Set label
marker.label = &quot;My Label&quot;;

// Set tag
marker.tags.Add(&quot;My Tag&quot;);

// Set custom data
marker[&quot;anyKey&quot;] = anyValue;

// Get marker by label
marker = OnlineMapsMarkerManager.instance.FirstOrDefault(m =&gt; m.label == &quot;My Label&quot;);

// Get marker by tag
marker = OnlineMapsMarkerManager.instance.FirstOrDefault(m =&gt; m.tags.Contains(&quot;My Tag&quot;));

// Get custom data
anyValue = marker[&quot;anyKey&quot;] as TypeOfValue;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-09-26T12:38:19Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7770#p7770</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: markerClick with labels]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7768#p7768" />
			<content type="html"><![CDATA[<p>I have different 2 D Markers created with the Online Maps Marker Manager and the markers are&nbsp; are organized with label&#039;s. <br />Now i want to instantiate a gameobjects when i click on a marker with a specific label. </p><p>I use the code from MarkerClickExample:</p><p>&nbsp; &nbsp; &nbsp; &nbsp; </p><div class="codebox"><pre><code>  public class MarkerClickExample : MonoBehaviour
    {
        private void Start()
        {
            OnlineMaps map = OnlineMaps.instance;

            // Add OnClick events to static markers
            foreach (OnlineMapsMarker marker in OnlineMapsMarkerManager.instance)
            {
                marker.OnClick += OnMarkerClick;
            }

            // Add OnClick events to dynamic markers
            OnlineMapsMarker dynamicMarker = OnlineMapsMarkerManager.CreateItem(Vector2.zero, null, &quot;dynamicMarker&quot;);
            dynamicMarker.OnClick += OnMarkerClick;
        }


  
        private void OnMarkerClick(OnlineMapsMarkerBase marker)
        {</code></pre></div><p>Problem is i dont know how to label or tag the different markers.<br />I need something like FindGameObjectWithTag(&quot;spown1&quot;) for the marker label if thats possible.</p><p>i hope its more clear now.</p>]]></content>
			<author>
				<name><![CDATA[landl0s]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1455</uri>
			</author>
			<updated>2021-09-25T20:28:55Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7768#p7768</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: markerClick with labels]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7766#p7766" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Unfortunately I didn&#039;t understand your question.<br />Please rephrase this in more detail.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-09-25T12:36:59Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7766#p7766</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[markerClick with labels]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7764#p7764" />
			<content type="html"><![CDATA[<p>hello im using the MarkerClickExample is it possible to call markers with spezific labels for different onclick events?</p>]]></content>
			<author>
				<name><![CDATA[landl0s]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1455</uri>
			</author>
			<updated>2021-09-25T11:44:03Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7764#p7764</id>
		</entry>
</feed>
