<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — How to get coordinates of 4 corners on mobile screen]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=486&amp;type=atom" />
	<updated>2017-04-04T03:33:04Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=486</id>
		<entry>
			<title type="html"><![CDATA[Re: How to get coordinates of 4 corners on mobile screen]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2148#p2148" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>Hello.</p><p>Yes, you need to use OnlineMapsControlBase.GetCoords. <br />Example:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class GetCoordinatesOfScreenCorners:MonoBehaviour
{
    public static void LogCorners()
    {
        double lng, lat;

        OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(0, 0));
        Debug.Log(&quot;Bottom left longitude: &quot; + lng + &quot;, latitude: &quot; + lat);

        OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(Screen.width, 0));
        Debug.Log(&quot;Bottom right longitude: &quot; + lng + &quot;, latitude: &quot; + lat);

        OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(Screen.width, Screen.height));
        Debug.Log(&quot;Top right longitude: &quot; + lng + &quot;, latitude: &quot; + lat);

        OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(0, Screen.height));
        Debug.Log(&quot;Top left longitude: &quot; + lng + &quot;, latitude: &quot; + lat);
    }

    private void OnGUI()
    {
        if (GUILayout.Button(&quot;Log corners&quot;)) LogCorners();
    }
}</code></pre></div></blockquote></div><p>thanks!</p>]]></content>
			<author>
				<name><![CDATA[anhdung.bka317]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=410</uri>
			</author>
			<updated>2017-04-04T03:33:04Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2148#p2148</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to get coordinates of 4 corners on mobile screen]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2140#p2140" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Yes, you need to use OnlineMapsControlBase.GetCoords. <br />Example:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class GetCoordinatesOfScreenCorners:MonoBehaviour
{
    public static void LogCorners()
    {
        double lng, lat;

        OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(0, 0));
        Debug.Log(&quot;Bottom left longitude: &quot; + lng + &quot;, latitude: &quot; + lat);

        OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(Screen.width, 0));
        Debug.Log(&quot;Bottom right longitude: &quot; + lng + &quot;, latitude: &quot; + lat);

        OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(Screen.width, Screen.height));
        Debug.Log(&quot;Top right longitude: &quot; + lng + &quot;, latitude: &quot; + lat);

        OnlineMapsControlBase.instance.GetCoords(out lng, out lat, new Vector2(0, Screen.height));
        Debug.Log(&quot;Top left longitude: &quot; + lng + &quot;, latitude: &quot; + lat);
    }

    private void OnGUI()
    {
        if (GUILayout.Button(&quot;Log corners&quot;)) LogCorners();
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-04-03T20:05:16Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2140#p2140</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How to get coordinates of 4 corners on mobile screen]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2130#p2130" />
			<content type="html"><![CDATA[<p>Hi <br />I&#039;m trying to get coordinates of 4 corners on screen of mobile to get all markers among that 4 corners. And their coordinate must be updated when I zoom in/out.<br />But I don&#039;t know how to do this. I used OnlineMapsControlBase.GetCoords, but it is not working.<br />Is there any way to do this?<br />Thanks!</p>]]></content>
			<author>
				<name><![CDATA[anhdung.bka317]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=410</uri>
			</author>
			<updated>2017-04-03T04:15:27Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2130#p2130</id>
		</entry>
</feed>
