09-01-2018 17:15
09-01-2018 17:15
I want to write a program that displays a message on my Ionic watch face when a certain latitude and longitude are reached. I am not sure of the javascript syntax required to access the GPS coords. Any suggestions? NB, I have some programming experience in a variety of languages but I am not a professional programmer.
Thanks
Best Answer09-03-2018 10:25
Fitbit Developers oversee the SDK and API forums. We're here to answer questions about Fitbit developer tools, assist with projects, and make sure your voice is heard by the development team.
09-03-2018 10:25
You can use watchPosition() as detailed here: https://dev.fitbit.com/build/guides/geolocation/
Depending on the accuracy of the location, you might want to limit the number of decimal places when comparing the lat and lon.
Something vaguely like:
if (position.coords.latitude.toFixed(2) === -0.12 && position.coords.longitude.toFixed(2) === 51.50) {
// roughly in London
}
Best Answer09-03-2018 15:20
09-03-2018 15:20
Best Answer