Start a new topic

How to Displaying Real-Time Distance

Hi, I'm new in developing AR. Here I use Android (JavaScript API) in developing AR GeoLocation and using SDK 8.10 and I use the sample (nativedetai screen). I want to ask how do I make the distance change real time when user moving? 

I'm using this code in marker.js


 var distanceToUserValue =
        (jarak > 999) ? ((jarak / 1000).toFixed(2) + ' km') :
        (Math.round(jarak) + ' m');

   and this for showing on label


 this.descriptionLabel = new AR.Label(distanceToUserValue, 0.45, {
        zOrder: 1,
        translate: {
            y: -0.40,
            x: 0.2
        style: {
            textColor: '#333333'


but when it showing different ouput on the label in 165m in the panel-detail 18m. How it can be like that ?


If you change the output in the SDK sample app to display the distance instead of the description in the POI marker, do you see the same behavior? Do you make sure to update all data with the location update?

Thx and greetings


Login or Signup to post a comment