Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mapbox error [HTTP] Unable to parse resourceUrl

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?

like image 790
Xwind Avatar asked May 18 '26 12:05

Xwind


1 Answers

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

like image 190
Exoriri Avatar answered May 21 '26 02:05

Exoriri



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!