Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

How to calculate distance I have travelled using cascades?

Hi,

 

I want to calculate distance I have travelled? How can I do that? If I use method distanceTo of geocoordinates,it will give me distance but that won't be in actual way I travelled but just a distance between 2 coordinates.

Rujuta Trivedi
Contributor
Posts: 43
Registered: ‎01-05-2013
My Device: Dev Alpha
My Carrier: Telenor Hungary

Re: How to calculate distance I have travelled using cascades?

Hi,

 

I think you can't do that right now with BB10 directly. You have the start point and the end point of the travel. With for example Google Maps APIs, you can get the route between these points. The route consists of geo points (lat, lon). If you summarize the distance between these points, you have the travels distance.

 

https://developers.google.com/maps/documentation/directions/

It has a simple REST interface. The only thing that is hard, is to decode the route information, but there are good example codes on the net.

 

hope it helps,

chriske 

--------------------------------------------------------------
If my post was helpful or it was the solution for Your problem, please don't forget to give me a like, and mark my post as a solution. Thanks!
Developer
Posts: 528
Registered: ‎10-06-2009
My Device: 9800,BB Dev Alpha,z10 limited edition
My Carrier: Vodafone

Re: How to calculate distance I have travelled using cascades?

but that way I will be able to calculate distance with predefined points from map but not the actual way I travelled

Rujuta Trivedi