Hello. I can not get calculate the distance between a POI and the user's position.
My POI:
var poi1 = new AR.GeoLocation(39.774769,-4.526367);
How I get the user's position? I think that the distance between both are:
var distance1 = user_position.distanceTo(poi1);
user_position???
Thank you.
Regards
W
Wolfgang Damm
said
about 10 years ago
you can use
poi1.distanceToUser()
which returns the distance to the user in meters. See the API Reference included with the SDK for details.
S
Sonia S.
said
about 10 years ago
Thank you very much Wolfgang for you answer. I try this, but i always get, "undefined".
What am I doing wrong?
Regards.
W
Wolfgang Damm
said
about 10 years ago
can you post your complete source code and/or an url to your World?
S
Sonia S.
said
about 10 years ago
When I publish the world in wikitude.me, the distance appears ok. But when I see the world wtih "wikitude-amv-v1.2" the distance appears as undefined.
Thanks Wolfgang.
W
Wolfgang Damm
said
about 10 years ago
I'm guessing you are refering to our DevZone (not wikitude.me). Uploading it to the DevZone and looking at it in Wikitude shouldn't be any different to looking at it using the AMV. Can you test with the latest AMV from the 2.0 SDK?
Sonia S.