AR.js
AR.js copied to clipboard
How to show msg distance on location bassed image
Can you show the code or example how to get distance text like here?
@MilosGlisovic to get the marker and text to appear together, you need to create a compound <a-entity>
containing both text and a marker as child entities (see the final peakfinder example in the location-based tutorial). To get the distance between the current location and another, you can use the Haversine formula, you can use the computeDistanceMeters()
method of gps-camera
or gps-projected-camera
to calculate this. Each object passed as an argument to this method should have latitude
and longitude
properties.
Hope this helps.
Thank you. I hope that be fine. I worked something with msgDistance. Thanks
Hi @MilosGlisovic Can you please share with me some code about it? Thanks
Sorry I didn't see the message. I want someting like this: https://www.youtube.com/watch?v=biCKHVefIe8 Create a-image and a-text like child element, and in a-text value put the distanceMsg attribute, but my code dont work