Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get GPS accuracy in react native

Is it possible to get the GPS accuracy in react native geolocation? i would like to know how many meters the result might differ in any given time, but I can not find if it is possible or not.

like image 502
rablentain Avatar asked Oct 14 '25 15:10

rablentain


1 Answers

Yes. You can get accuracy by call getCurrentPosition() method of class Geolocation of React Native

This method allows us to request a user’s location at any time. It accepts three parameters — a success callback, an error callback, and a configuration object. The success callback will be passed an object that looks like:

{
  "timestamp": 1484669056399.49,
  "coords": {
    "accuracy": 5,
    "altitude": 0,
    "altitudeAccuracy": -1,
    "heading": -1,
    "latitude": 37.785834,
    "longitude": -122.406417,
    "speed": -1
  }
}
like image 86
valerybodak Avatar answered Oct 17 '25 13:10

valerybodak