React-native-mapbox-gl: [v6] iOS 11.1 - Map stays blank

Created on 7 Nov 2017  路  9Comments  路  Source: nitaliano/react-native-mapbox-gl

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
bildschirmfoto 2017-11-07 um 19 30 30

Most helpful comment

All 9 comments

@creimers what are the styles on the parent container?

display: flex;
flex: 2;

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

max-prokopenko picture max-prokopenko  路  4Comments

Craytor picture Craytor  路  3Comments

lucasbento picture lucasbento  路  3Comments

kristfal picture kristfal  路  3Comments

madroneropaulo picture madroneropaulo  路  4Comments