<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — Adding a "OnClick" function to the position GPS marker]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=572</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=572&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Adding a "OnClick" function to the position GPS marker.]]></description>
		<lastBuildDate>Thu, 15 Jun 2017 21:48:45 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Adding a "OnClick" function to the position GPS marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2474#p2474</link>
			<description><![CDATA[<p>Hello.</p><p>Example:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class ClickOnLocationMarker:MonoBehaviour
{
    private void Start()
    {
        OnlineMapsLocationService.instance.OnLocationInited += OnLocationInited;
    }

    private void OnLocationInited()
    {
        // Delay because the marker is created after OnLocationInited.
        // We&#039;ll fix this in the next version.
        OnlineMaps.instance.OnUpdateLate += OnUpdateLate;
    }

    private void OnUpdateLate()
    {
        OnlineMaps.instance.OnUpdateLate -= OnUpdateLate;
        if (OnlineMapsLocationService.marker != null) OnlineMapsLocationService.marker.OnClick += OnMarkerClick;
    }

    private void OnMarkerClick(OnlineMapsMarkerBase marker)
    {
        Debug.Log(marker.position.ToString(&quot;F4&quot;));
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 15 Jun 2017 21:48:45 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2474#p2474</guid>
		</item>
		<item>
			<title><![CDATA[Adding a "OnClick" function to the position GPS marker]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2472#p2472</link>
			<description><![CDATA[<p>Hi everyone,</p><p>Everything is pretty much in the title, I have a Map with a OnlineMapsLocationService Script. This script displays a 2D marker at the user&#039;s position.</p><p>How can I make this marker clickable ? <br />Thank you,</p><p>Quentin</p>]]></description>
			<author><![CDATA[null@example.com (qlemee)]]></author>
			<pubDate>Thu, 15 Jun 2017 13:51:50 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2472#p2472</guid>
		</item>
	</channel>
</rss>
