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.
E
Eva
said
over 7 years ago
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?
Thanks
J
Jack Lu
said
over 7 years ago
I created a RelativeLocation like this:
var location = new AR.RelativeLocation(null, 1000, 1000);
then I call distanceToUser on it:
location.distanceToUser();
What I get is undefined, but I'm sure I get distance from RelativeLocation before.
Jack Lu