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!
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
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
This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.