# Lat-lng of touch event on lightship map

**URL:** <https://forum.8thwall.com/t/lat-lng-of-touch-event-on-lightship-map/1343>\
**Category:** Technical Support\
**Tags:** lightship-maps\
**Created:** [May 10, 2024, 6:40pm UTC](https://forum.8thwall.com/t/lat-lng-of-touch-event-on-lightship-map/1343 "2024-05-10T18:40:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jamil\_Khan](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jamil\_Khan](https://forum.8thwall.com/u/Jamil_Khan)\
**Post date:** [May 10, 2024, 6:40pm UTC](https://forum.8thwall.com/t/lat-lng-of-touch-event-on-lightship-map/1343/1 "2024-05-10T18:40:39Z")

</div>

While I see that the `<lightship-map>` element itself has a lat-lng attribute which is useful for determining the user’s current location, I’m not sure how to handle getting the lat/lng of a location on the map a user has touched (i.e. clicked in the simulator or touch-event on device)  
Not sure if there’s a working example/existing documentation that covers this.  
Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Jamil\_Khan](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jamil\_Khan](https://forum.8thwall.com/u/Jamil_Khan)\
**Post date:** [May 20, 2024, 1:06pm UTC](https://forum.8thwall.com/t/lat-lng-of-touch-event-on-lightship-map/1343/2 "2024-05-20T13:06:32Z")

</div>

If there isn’t something out of the box to get the lat/lng of the point on the map touched, I am thinking I will try something like adding an invisible plane to the scene, generating a three js pick ray that only interacts with the plane, and use either the UV or scene coordinates of the intersection to map back to lat/lng. Would be interested in hearing other suggestions if there’s a better way to accomplish this 🙂

---

<div class="post-metadata">

**Author:** ![Jamil\_Khan](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jamil\_Khan](https://forum.8thwall.com/u/Jamil_Khan)\
**Post date:** [May 28, 2024, 12:52am UTC](https://forum.8thwall.com/t/lat-lng-of-touch-event-on-lightship-map/1343/3 "2024-05-28T00:52:39Z")

</div>

Generating a pick ray from a THREE raycaster seems to work to get the lat-lng of a clicked map point. See the `map-click.js` component. Not entirely sure why a few of the magic numbers work, but this seems to be a reasonable starting point: [Map Click Lat Lng | Jamil Khan | 8th Wall](https://www.8thwall.com/jamilkhan/map-click)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex019/uploads/x8thwall/original/2X/9/9212a857458f1b03a6accb129e0f8cbea408e3e5.png) [@system](https://forum.8thwall.com/u/system)\
**Post date:** [June 1, 2024, 12:52am UTC](https://forum.8thwall.com/t/lat-lng-of-touch-event-on-lightship-map/1343/4 "2024-06-01T00:52:58Z")

</div>

Closed on June 1, 2024, 12:52am UTC

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.
