N
N
Newbie Ivanovich2019-08-28 10:29:10
Geolocation
Newbie Ivanovich, 2019-08-28 10:29:10

How to get coordinates in react-native + expo?

I start tracking coordinates in expo

let locat = await Location.startLocationUpdatesAsync('Location',{ accuracy: Location.Accuracy.Balanced, 
            timeInterval: 1000, 
            distanceInterval: 0 }, loc => this.setState({ location:loc }));

location does not change when changing coordinates
, an array of coordinates appears in the task manager
TaskManager.defineTask('Location', ({ data: { locations }, error }) => {
    if (error) {
      // check `error.message` for more details.
      return;
    }
    console.log('Received new locations', locations);
  });

How to get coordinates as object in expo +rect-native?
TrackingScreen class

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Alexandrovich, 2019-08-28
@NovichokIvanovich

I use for geolocation https://github.com/Agontuk/react-native-geolocatio...
so far the best package I've seen

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question