yes Eva i did but i have a probleme in passing the variable of distance value to my marker a s label???
yes Eva i tried but no point !!!
my probleme is that i want to display the distance to a POI on the marker but i don't know how to create the label to do so !
var distanceToUserValue = (marker.distanceToUser > 999) ? ((marker.distanceToUser / 1000).toFixed(2) + " km") : (Math.round(marker.distanceToUser) + " m"); $("#poi-detail-distance").html(distanceToUserValue);
Then you need to add it to the details of the poi
//decide which data you want to saw within the label var poiData = { "id": 1, "longitude": (lon + (Math.random() / 5 - 0.1)), "latitude": (lat + (Math.random() / 5 - 0.1)), "altitude": 100.0, "description": "This is the description of POI#1", "title": "POI#1" //so here you can simply add the distance as well };
Last step is to create the label. See here further instructions on how. Hope that helps.
Thanks
Eva
try this code :
var distance = (markerLocation.distanceToUser() > 999) ? ((markerLocation.distanceToUser() / 1000).toFixed(2) + " km") : (Math.round(markerLocation.distanceToUser()) + " m"); this.descriptionLabel = new AR.Label(distance, 0.8, { zOrder: 1, translate: { y: -0.55 }, style: { textColor: '#FFFFFF' } });
hope that cide work for you :)
Z3ifrimoha
hello,
i'm trying to show the distance to poi on a marker but it returns "undefined" i tried the label :
and i called it in AR.GeoObject!