Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mapboxgl api access error : {"message":"Not Found"}

Tags:

mapbox-gl-js

I'm using mapbox studio to produce custom map and accessing that style in js. but I'm not able to access that style when calling api. it simply returns with {"message":"Not Found"} I can directly access the api link through mapbox studio. In mapbox studio in styles we have map style id and api link. so i can access it using that link but when I actually use in my application it's not working.

here is the code where I'm getting error:

               map.addSource('parcels', {
                    "type": "vector",
                    "url": "mapbox://styles/ch*****/ci****************"
                });

Hoping to get some good help. thanks Akshay

like image 944
Akshay14 Avatar asked Jun 29 '26 19:06

Akshay14


1 Answers

There are two potential causes for Not Found errors:

You are looking at an area of the map where there is no data. The Mapbox API responds with a 404 status code to indicate "no data" for vector tiles. These messages can be ignored. Try panning to an area where there is data.

You are using the wrong access token. Make sure you are using an access token from the account used to create the map. You can read more about Mapbox access tokens here https://www.mapbox.com/help/define-access-token

like image 70
Lucas Wojciechowski Avatar answered Jul 01 '26 19:07

Lucas Wojciechowski



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!