Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Geolocation on Versa: Getting longitude & latitude but not speed and heading

Hi.

 

I'm working on an app for showing interesting stats during sailing.

I mostly need to get the user's Speed and Heading.

I looked at the geolocation docs and was glad to see how easy it is to query location information and have the SDK get location data from the phone for the Versa since it doesn't have a built-in GPS.

However when testing with a real Versa I see that I am successfully getting frequent location data updates (longitude & latitude) but `speed` and `heading` are always `0`.

 

My question:

Are speed and heading expected to work on the Versa (when connected to a phone)?

 

If not, I guess can I can calculate the speed using the frequent coordinate updates I get.  Is this a good idea?

Writing my own code to do this seems eror-prone. Is there an example app where this has already been demonstrated perhaps?

 

Thanks!

Best Answer
1 REPLY 1

If anyone else encounters this problem, I found a workaround.

I used the excellent open-source library https://github.com/manuelbieh/geolib.

It allowed me to calculate speed and heading based on a current and previous location samples.

I published my project here: https://github.com/cowchimp/fitbit-embarked

Best Answer