mapbox / mapbox-gl-js

Interactive, thoroughly customizable maps in the browser, powered by vector tiles and WebGL
https://docs.mapbox.com/mapbox-gl-js/
Other
11.2k stars 2.22k forks source link

Terrain (RGB-encoded DEM) datasource returns 404 for empty tiles #10229

Open sukhanovr opened 3 years ago

sukhanovr commented 3 years ago

mapbox-gl-js version: 2.0.0

browser: Chrome, Firefox

Steps to Trigger Behavior

  1. Use style with Terrain (RGB-encoded DEM) source and layer
  2. Navigate to any sea area

Link to Demonstration

https://jsfiddle.net/m6k791hj/6/ Coordinates are set to [0, 0], middle of the ocean, and there is of course no tiles for that region so tileset returns multiple 404.

image

Expected Behavior

As claimed in the issue tilesets should return 204 (No Content) for such cases

Actual Behavior

404 (Not Found) is returned

JuanIrache commented 2 years ago

If this happens the "idle" event does not fire, so if our program depends on it it gets stuck. Any workarounds? Any way to make these failed requests fire the "error" event?