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

some questions on geolocation.

 

The guide advises that the geolocation.watchPosition's  callback "is called each time the location changes." 

In a continuously moving environment (e.g. a racing yacht) the location is changing continuously, which casts doubt on that. My questions are:

  1. Is the callback actually called every second, on the second?
  2. is the timestamp actually the raw GPS timestamp? ( I ask, because some other devices: Smiley Wink  actually report the device's system time)
  3. What is the reported precision of the latitude/longitude/speed/heading coordinates, i.e. how many decimals are reported?
  4. Do the speed and heading coordinates come from the GPS sub-system or are they derived from the time and distance in the firmware?

 

Best Answer
10 REPLIES 10

Interested in answers as well, and in the same context of the moving yacht.

Best Answer

Can a developer please do some simple tests to answer some of this question?

Best Answer
0 Votes

I am interested in hearing more as well. I could not get watchposition to work, based on the example in the guide. Geolocation works, but watchposition does not export data. If someone is looking into this, can you let me know if I should change something from the example?

 

Best Answer
0 Votes

@agsurf5 wrote:

I am interested in hearing more as well. I could not get watchposition to work, 

 

So what did you get? Could you post your code and its results?

 

Best Answer
0 Votes

I used the code from the guide:

https://dev.fitbit.com/guides/geolocation/#monitoring-the-current-location

 

Can an get the coordinates for getCurrentPosition, but not for watchPosition

Best Answer

do you get anything from your loctionSuccess function?

function locationSuccess(position) {
    console.log("Latitude: " + position.coords.latitude,
                "Longitude: " + position.coords.longitude);
}

 Reading the Guide it seems you should only get a response "...each time the location changes." Which contradicts the Reference  on watchPosition() :"Request that the system monitor the position continuously and report position updates as available"
I wonder what is really going on?

Best Answer
0 Votes

WatchPosition is blank for me. Neither location nor error

Best Answer
0 Votes

There is definitely a bug with watchPosition(), I've escalated this with the firmware team.

 

  1. Is the callback actually called every second, on the second? 
    This depends upon how you configure the options. See below.

  2. is the timestamp actually the raw GPS timestamp? ( I ask, because some other devices: Smiley Wink  actually report the device's system time)
    This is the GPS timestamp.

  3. What is the reported precision of the latitude/longitude/speed/heading coordinates, i.e. how many decimals are reported?

    {
    "coords":{
        "accuracy":49.9,
        "latitude":51.724331666666664,
        "longitude":-4.508001666666667,
        "altitude":41,
        "altitudeAccuracy":null,
        "heading":1.32,
        "speed":0.86426592
    },
        "timestamp":1508801196000
    }

  4. Do the speed and heading coordinates come from the GPS sub-system or are they derived from the time and distance in the firmware?

    From the GPS, as far as I know.

The API is designed in partity with:

https://developer.mozilla.org/en-US/docs/Web/API/Geolocation

Best Answer
0 Votes

@JonFitbit wrote:

 

  1. Is the callback actually called every second, on the second? 
    This depends upon how you configure the options. See below.

I didn't see any ref to configure the options.

 

And what is the nature of the bug you have escalated?

 

Best Answer
0 Votes

@raceQs wrote:

@JonFitbit wrote:

 

  1. Is the callback actually called every second, on the second? 
    This depends upon how you configure the options. See below.

I didn't see any ref to configure the options.

 

And what is the nature of the bug you have escalated?

 


The options were on the link, sorry https://developer.mozilla.org/en-US/docs/Web/API/PositionOptions

 

The bug is that watchPosition() doesn't seem to be working. 

Best Answer