react-native-mapbox-gl
react-native-mapbox-gl copied to clipboard
showUserLocation not working on Android
The map is working fine on iOS, but I can't see the user location on Android (zoom and coords aren't working well either).
I followed the installation instructions and have the FINE_LOCATION and other permissions granted.
The only thing I changed was in my build.gradle
, to prevent the app from crashing:
compile (project(':mapbox-react-native-mapbox-gl')) {
compile ('com.squareup.okhttp3:okhttp:3.6.0') {
force = true
}
}
I'm having the same issue
I'm also having this problem
what location engine are you using?
Same here on Android, but working well on iOS emulator.
what location engine are you using?
I have this issue as well, adding the parameter userTrackingMode makes the map break.
Doing some testing, i still haven't figure this out completely but i tried requesting permissions like this and it worked (reference link)
import { PermissionsAndroid } from 'react-native';
...
componentDidMount() {
{
PermissionsAndroid.requestMultiple(
[PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,
PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION],
{
title: 'Give Location Permission',
message: 'App needs location permission to find your position.'
}
).then(granted => {
console.log(granted);
resolve();
}).catch(err => {
console.warn(err);
reject(err);
});
}
And i was able to pickup the location and zoom in. I'm still having troubles though. I have to restart the app to show the location. I guess it has to do with where i'm requesting the permissions. I don't have the permissions in the AndroidManifest.xml
.
Android: 8.0 react-native: 0.56.0 react-native-mapbox-gl: 6.1.3
still not working for me