<?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 — Detect tap on a route drawn with Drawing API]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=2229</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2229&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Detect tap on a route drawn with Drawing API.]]></description>
		<lastBuildDate>Thu, 08 Feb 2024 08:27:59 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Detect tap on a route drawn with Drawing API]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9389#p9389</link>
			<description><![CDATA[<p>Hi Alex, oh my, I must have missed this <img src="https://forum.infinity-code.com/img/smilies/lol.png" width="15" height="15" alt="lol" /><br />I actually searched the example atlas for &#039;tap&#039; or &#039;click&#039;, but nothing fitting came up. Thanks for pointing me in the right direction, that is exactly what I need <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (lwRaft)]]></author>
			<pubDate>Thu, 08 Feb 2024 08:27:59 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9389#p9389</guid>
		</item>
		<item>
			<title><![CDATA[Re: Detect tap on a route drawn with Drawing API]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9387#p9387</link>
			<description><![CDATA[<p>Hello.</p><p>Use Drawing Element events.<br />Example:<br /><a href="https://infinity-code.com/atlas/online-maps/pages/DrawingElementEventsExample.html">https://infinity-code.com/atlas/online- … ample.html</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 07 Feb 2024 13:07:54 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9387#p9387</guid>
		</item>
		<item>
			<title><![CDATA[Re: Detect tap on a route drawn with Drawing API]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9386#p9386</link>
			<description><![CDATA[<p>Addition to my question, I discovered your example for screen coordinate to geographic coordinate conversion.<br />I adapted the script for touch position like this:</p><div class="codebox"><pre><code>using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DetectTapOnRoute : MonoBehaviour
{
    public OnlineMapsControlBase control;

    void Start()
    {
        if (control == null) control = OnlineMapsControlBase.instance;
    }

    // Update is called once per frame
    void Update()
    {
        if (Input.touchCount &gt; 0)
        {
            Touch touch = Input.GetTouch(0);
            // Screen coordinate of the touch.
            Vector3 touchPosition = new Vector3(touch.position.x, touch.position.y, 0);

            // Converts the screen coordinates to geographic.
            Vector3 touchGeoLocation = control.GetCoords(touchPosition);

            // Showing geographical coordinates in the console.
            Debug.Log(&quot;touch geo location &quot; + touchGeoLocation);
        }
    }
}</code></pre></div><p>But it doesn&#039;t work reliably yet. Of course, when dragging the map, I get back 0,0,0.</p><p>Unfortunately I also get 0,0,0 most of the time when tapping on random positions on the map.<br />In between, there are some random successful hits with kind of fitting geographic coordinates, but I only get back coordinates (other than 0,0,0) for like 10% of the taps. Any ideas on why it only works for a fraction of my taps?</p>]]></description>
			<author><![CDATA[null@example.com (lwRaft)]]></author>
			<pubDate>Wed, 07 Feb 2024 12:00:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9386#p9386</guid>
		</item>
		<item>
			<title><![CDATA[Detect tap on a route drawn with Drawing API]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9385#p9385</link>
			<description><![CDATA[<p>Hi there,</p><p>is there the possibility to detect a tap on mobile (or at least a click) on a route drawn with the Drawing API? I want the user to be able to select one of several drawn routes. </p><p>Thanks in advance.</p>]]></description>
			<author><![CDATA[null@example.com (lwRaft)]]></author>
			<pubDate>Wed, 07 Feb 2024 11:22:45 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9385#p9385</guid>
		</item>
	</channel>
</rss>
