<?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 — Check if GPS location reports within map boundaries]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1423</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1423&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Check if GPS location reports within map boundaries.]]></description>
		<lastBuildDate>Mon, 13 Jan 2020 00:24:22 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Check if GPS location reports within map boundaries]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5856#p5856</link>
			<description><![CDATA[<p>Thanks. The solution works very well.</p>]]></description>
			<author><![CDATA[null@example.com (vgi)]]></author>
			<pubDate>Mon, 13 Jan 2020 00:24:22 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5856#p5856</guid>
		</item>
		<item>
			<title><![CDATA[Re: Check if GPS location reports within map boundaries]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5855#p5855</link>
			<description><![CDATA[<p>Hello.</p><p>Something like that:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class LocationInMapView:MonoBehaviour
{
    private bool InMapView(double longitude, double latitude)
    {
        double tlx, tly, brx, bry;
        OnlineMaps.instance.GetCorners(out tlx, out tly, out brx, out bry);
        if (latitude &gt; tly || latitude &lt; bry) return false;

        if (tlx &gt; brx)
        {
            brx += 360;
            if (longitude &lt; tlx) longitude += 360;
        }

        return tlx &lt;= longitude &amp;&amp; brx &gt;= longitude;
    }

    private void OnLocationChanged(Vector2 location)
    {
        bool inMapView = InMapView(location.x, location.y);
        Debug.Log(inMapView? &quot;In Map View&quot;: &quot;Outside Map View&quot;);
    }

    private void Start()
    {
        OnlineMapsLocationService.instance.OnLocationChanged += OnLocationChanged;
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sun, 12 Jan 2020 12:08:38 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5855#p5855</guid>
		</item>
		<item>
			<title><![CDATA[Check if GPS location reports within map boundaries]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5854#p5854</link>
			<description><![CDATA[<p>We are working on a project that requires to detect if the user GPS location is within the map boundaries. Any suggestions?</p>]]></description>
			<author><![CDATA[null@example.com (vgi)]]></author>
			<pubDate>Sat, 11 Jan 2020 22:23:08 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5854#p5854</guid>
		</item>
	</channel>
</rss>
