<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Doubt to access latitude and longitude in ArcGIS Maps SDK for Unity Questions</title>
    <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/doubt-to-access-latitude-and-longitude/m-p/1364691#M748</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hi Everyone&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am new to unity I have a doubt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ArcGIS Location is the location of camera. Is there any way to get the location of cursor where we point mouse pointer in the map&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Dec 2023 05:17:15 GMT</pubDate>
    <dc:creator>Manoj081498</dc:creator>
    <dc:date>2023-12-28T05:17:15Z</dc:date>
    <item>
      <title>Doubt to access latitude and longitude</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/doubt-to-access-latitude-and-longitude/m-p/1364691#M748</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Everyone&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am new to unity I have a doubt&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ArcGIS Location is the location of camera. Is there any way to get the location of cursor where we point mouse pointer in the map&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 05:17:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/doubt-to-access-latitude-and-longitude/m-p/1364691#M748</guid>
      <dc:creator>Manoj081498</dc:creator>
      <dc:date>2023-12-28T05:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt to access latitude and longitude</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/doubt-to-access-latitude-and-longitude/m-p/1364703#M749</link>
      <description>&lt;P&gt;Since you are new to Unity, I would check out the Camera.ScreenToWorldPoint (&lt;A href="https://docs.unity3d.com/ScriptReference/Camera.ScreenToWorldPoint.html" target="_blank"&gt;https://docs.unity3d.com/ScriptReference/Camera.ScreenToWorldPoint.html&lt;/A&gt;) method to learn more about how Unity translates the x/y screen point(2D) into a world point(3D).&lt;BR /&gt;Once you understand that, you can get the lat/long location of the map as follows:&lt;BR /&gt;In a script that is attached to the Map GameObject, you will need to cast a ray from the camera at the touch position.&amp;nbsp; touchPos is a Vector3 point where the screen is touched&lt;BR /&gt;Ray ray = Camera.main.ScreenPointToRay(touchPos);&lt;BR /&gt;RaycastHit[] hits = UnityEngine.Physics.RaycastAll(ray);&lt;BR /&gt;&lt;BR /&gt;In the hits array, one of the hits will be a hit on the map.&amp;nbsp; Using the point property of the hit you can get the lat/lng as follows:&lt;BR /&gt;ArcGISMapComponent mapComponent = gameObject.GetComponentInParent&amp;lt;ArcGISMapComponent&amp;gt;();&lt;BR /&gt;ArcGISPoint coords = mapComponent.EngineToGeographic(h.point);&lt;/P&gt;&lt;DIV&gt;&lt;SPAN&gt;lat = coords.Y;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;lng = coords.X;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;Review the ArcGISPoint API reference here:&lt;BR /&gt;&lt;A href="https://developers.arcgis.com/unity/api-reference/gameengine/geometry/arcgispoint/" target="_blank"&gt;https://developers.arcgis.com/unity/api-reference/gameengine/geometry/arcgispoint/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2023 10:22:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/doubt-to-access-latitude-and-longitude/m-p/1364703#M749</guid>
      <dc:creator>ChrisRenzi</dc:creator>
      <dc:date>2023-12-28T10:22:46Z</dc:date>
    </item>
    <item>
      <title>Re: Doubt to access latitude and longitude</title>
      <link>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/doubt-to-access-latitude-and-longitude/m-p/1365255#M753</link>
      <description>&lt;P&gt;I have tried what you said but it is not working.&lt;/P&gt;&lt;P&gt;can you assist further&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jan 2024 04:54:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-maps-sdk-for-unity-questions/doubt-to-access-latitude-and-longitude/m-p/1365255#M753</guid>
      <dc:creator>Manoj081498</dc:creator>
      <dc:date>2024-01-02T04:54:26Z</dc:date>
    </item>
  </channel>
</rss>

