Start a new topic

RelativeLocation.distanceToUser() returns undefined

RelativeLocation.distanceToUser() returns undefined

Maybe I got the case. I suspect it's because there's no GPS connection at that time.

Previously I thought wikitude determines distanceToUser for a RelativeLocation with a null reference without GPS data, since it represents a location relative to user himself. Now it seems that it's still using GPS data to calculate distanceToUser for such a RelativeLocation.

Hello Jack,

We tested the code you pasted here in our samples and it is working fine. Could you please check your code again or download our sample and check it there?


I created a RelativeLocation like this:

var location = new AR.RelativeLocation(null, 1000, 1000);

then I call distanceToUser on it:


What I get is undefined, but I'm sure I get distance from RelativeLocation before.

What am I doing wrong?
Login or Signup to post a comment