setup
react-native 0.50.1
react 16.0.0
react-native-mapbox-gl 6.0.0-beta2
problem
Installation, setup and build following the docs went as expected and without errors. However, the MapView does not display any tiles. It just stays blank. All I see is the Mapbox logo and the little info icon. No error logs anywhere. Any ideas?
code
<MapboxGL.MapView
zoomLevel={2}
centerCoordinate={[-35.15165038, 40.62357280]}
style={{flex: 1}}
styleURL={MapboxGL.StyleURL.Light}
/>
screenshot

@creimers what are the styles on the parent container?
display: flex;
flex: 2;
did you set your access token https://github.com/mapbox/react-native-mapbox-gl/blob/master/example/src/App.js#L130?
No. Where do I set it?
Like this probably, isn't it?
Yup, haha I just edited my comment with the link, and on Android if you're going to do anything location based you need to make sure you request for location permissions. I like to set it in my Apps componentWillMount normally, so I never have to worry about it again.
I can confirm that it was indeed the missing access token that led to the described behaviour. Thank you!
Ok, I had the issue where my map was not showing on Android but worked on iOS...
The solution is to add in
dependencies {
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:5.5.1'
}
Please add this into the documentation, but seems like not a lot of people have had this issue.. But this fixes it.. :) <3
How do I implement my custom map from Mapbox sdk to my react native code. Code sample please?
Most helpful comment
did you set your access token https://github.com/mapbox/react-native-mapbox-gl/blob/master/example/src/App.js#L130?