<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Marker position]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=472&amp;type=atom" />
	<updated>2017-03-22T13:18:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=472</id>
		<entry>
			<title type="html"><![CDATA[Re: Marker position]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2075#p2075" />
			<content type="html"><![CDATA[<p>Hello.</p><p>You mean 3D markers, right?!</p><p>OnClick example:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class LogMarker3DPosition:MonoBehaviour
{
    private void Start()
    {
        OnlineMapsMarker3D marker3D = OnlineMapsControlBase3D.instance.AddMarker3D(OnlineMaps.instance.position, null);
        marker3D.OnClick += OnMarkerClick;
    }

    private void OnMarkerClick(OnlineMapsMarkerBase marker)
    {
        double lng, lat;
        marker.GetPosition(out lng, out lat);
        Debug.Log(&quot;Marker3D latitude: &quot; + lat + &quot;, longitude: &quot; + lng);
    }
}</code></pre></div><br /><p>Example from another script:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class LogMarker3DPositionFromAnotherScript:MonoBehaviour
{
    private void OnMouseUpAsButton()
    {
        OnlineMapsMarkerBase marker = GetComponent&lt;OnlineMapsMarker3DInstance&gt;().marker;
        double lng, lat;
        marker.GetPosition(out lng, out lat);
        Debug.Log(&quot;Marker3D latitude: &quot; + lat + &quot;, longitude: &quot; + lng);
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-03-22T13:18:36Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2075#p2075</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Marker position]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2074#p2074" />
			<content type="html"><![CDATA[<p>Hi, i need to take latitude and longitude of a marker clicked; now i attached my custom script on the prefab of my marker with onmousedown(), i saw you have onclick() how can i use it and how can i take clicked marker&#039;s coords?</p>]]></content>
			<author>
				<name><![CDATA[valerio.paventi]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=367</uri>
			</author>
			<updated>2017-03-22T11:17:24Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2074#p2074</id>
		</entry>
</feed>
