2

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

Akshay14
  • 31
  • 1
  • 4

1 Answers1

3

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

Lucas Wojciechowski
  • 3,695
  • 16
  • 19
  • 1
    thanks for your kind response @Lucas . I figured it out and I was getting confused with style and mapid, so in api instead of calling mapid, i was using mapstyle name/id, so it was giving me error. you don't believe it took 1 week to understand this ....anyways thanks – Akshay14 Mar 03 '16 at 01:00
  • For others, my answer here might be what you're looking for: https://stackoverflow.com/questions/42772538/mapbox-how-to-avoid-javascript-errors-for-tilesets-that-arent-available-at-the?rq=1 – Steve Bennett Jul 20 '17 at 07:11