Reputation: 165
I've been working with Mapbox GL JS and working with adding data layers over the base map. For some reason, I keep getting a 404 error on a requested tile even though the data overlay shows up as expected. I've checked and double checked to make sure that I got the source id and source layer references correct, using this as a reference point.
This is the snippet I'm having issues with.
map.addSource('neighborhoods', {
type: 'vector',
url: 'mapbox://shortdiv.cj4u72j500fu72qplj0xcusp3-738n8'
})
map.addLayer({
'id': 'neighborhood-bounds',
'source': 'neighborhoods',
'source-layer': 'chicago_neighborhoods',
'type': 'line',
'paint': {
"line-color": "#ad0403",
"line-width": 2
}
});
Upvotes: 1
Views: 1414
Reputation: 1602
It is returning 404 for tiles in areas that contain no data in your custom dataset, so the Mapbox Uploads API did not create the tile, and thus it does not exist and 404s when requested. You're not doing anything wrong and your map should still work as expected. We suppress the errors on the mapbox-gl-js side, but there is no way to suppress the error generated by the browser.
Upvotes: 2