Search code examples
javascriptreact-nativegeolocation

In which unit is showed the accuracy using navigator.geolocation.getCurrentPosition in React Native?


I'm using navigator.geolocation.getCurrentPosition() function to get the current position of my phone.

It returns me a lot of information like latitude, longitude... And also the accuracy. I would like to know what's the unit that accuracy is using because I have no information about it, it just return a number.

For example, I get returned accuracy: 921, are they meters? Are they miles? I don't find the documentation about it.

And I would like to know what could be the maximum valor of the accuracy, if a maximum exists


Solution

  • accuracy is expressed in meters like it is described in Mozilla Docs:

    The Coordinates.accuracy read-only property is a strictly positive double representing the accuracy, with a 95% confidence level, of the Coordinates.latitude and Coordinates.longitude properties expressed in meters.

    source:https://developer.mozilla.org/en-US/docs/Web/API/Coordinates/altitude