I'm trying to integrate map in my React Native app using Mapbox
I follow the instructions for Android: creating access token, trying all 3 implementations, but I keep getting this error
Mapbox error [HTTP] Unable to parse resourceUrl mapbox://styles/mapbox/streets-v11 {"level": "error", "message": "[HTTP] Unable to parse resourceUrl mapbox://styles/mapbox/streets-v11", "tag": "Mbgl-HttpRequest"}
And the map is completely black like this
Does anyone know what causes the problem and how to fix it?
I also had this issue. By exploring GitHub found a solution and finally made it work in my app. Before you define MapboxGL.setAccessToken, you need to put MapboxGL.setWellKnownTileServer('Mapbox'). Your code will look like:
MapboxGL.setWellKnownTileServer('Mapbox');
MapboxGL.setAccessToken("<YOUR_ACCESS_TOKEN>");
Here is a reference to this issue https://github.com/rnmapbox/maps/issues/1840
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With