Start a new topic

Distance to a POI?

Distance to a POI?

Hello. I can not get calculate the distance between a POI and the user's position.


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);


Thank you.




you can use


which returns the distance to the user in meters. See the API Reference included with the SDK for details.

Thank you very much Wolfgang for you answer. I try this, but i always get, "undefined". 

What am I doing wrong?


can you post your complete source code and/or an url to your World?

When I publish the world in, the distance appears ok. But  when I see the world wtih "wikitude-amv-v1.2" the distance appears as undefined.

Thanks Wolfgang.

I'm guessing you are refering to our DevZone (not 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?
Login or Signup to post a comment