reactjsreact-nativemapboxuserlocation

how to use Mapbox.userlocation


I am trying to use mapbox in react native and i want the location of the user. the function mapbox.userlocation can be used with the mapbox.mapview. but i would like to use the location in some other way too.

Any suggestions?


Solution

  • MapBox provides you with UI components. One of the possible ways is to use the function onUserLocationUpdate from https://github.com/rnmapbox/maps/blob/main/docs/MapView.md. However better approach is to use the right library for it, for example https://github.com/michalchudziak/react-native-geolocation