Start a new topic

How to show distance from user to POI on marker?

How to show distance from user to POI on marker?

1 person has this problem


 

//English isn?t my first language, so please excuse any mistakes.

 

I'm using Wikitude phonegap plugin + HTML5 

 

From this example. http://www.wikitude.com/external/doc/documentation/latest/phonegap/browsingpois.html#browsing-pois

 

I want to show distance from user to POI on marker like  this picture. Do you have any examples or tutorials?

 



 

Thank you 

Hi,

We don't have a specific example, however, the steps to do it are fairly straight forward:


Use geoLocation.distanceToUser to calculate the distance of the geoLocation to the user

Use the resulting value to update your marker (Label, HtmlDrawable or whatever you're using for visualization)

Listen on context.onLocationChanged and run the distance calculation function in point 1 whenever the user changes location to update the distance.


The samples application in our examples uses a very similar approach, but updates the HTML content. Just follow along with this example, and instead of updating the HTML, update the text in your markers.

Best,

Martin
Login or Signup to post a comment