Esri / jsapi-resources

A collection of resources for developers using the ArcGIS Maps SDK for JavaScript.
https://developers.arcgis.com/javascript/latest/
Apache License 2.0
713 stars 565 forks source link

WebTileLayer Hosted Tile Server 204 No-Content Response #543

Open Apesosmarc opened 2 weeks ago

Apesosmarc commented 2 weeks ago

IMPORTANT

Actual behavior

Using the a WebTileLayer pointing to a hosted tile server using the urlTemplate property. My server returns tiles as expected. However when the requested tile does not exist I return a 204, and get an error in the browser saying the tile was unable to be loaded.

I can send a blank_tile.png back to the server when the asset is not found to avoid this error but this seems redundant when the map is requesting a multitude of files that don't exist.

Expected behavior

The frontend should ideally render a blank tile when receiving a 204 network status request rather than trying and throwing an error when loading an image that doesn't exist in the request.

Browser Error Example:

{
    "name": "request:server",
    "message": "Unable to load tile 17/49193/38845",
    "details": {
        "error": {
            "stack": "Error: The source image could not be decoded."
        },
        "level": 17,
        "row": 49193,
        "col": 38845
    }
}

Reproduction sample

https://codesandbox.io/p/sandbox/x7jt94

Reproduction steps

  1. Integrate web server that returns 204 at line 46 in index.html
  2. Open devtools, observe unable to load/render error being thrown in map.

Reproduction browser

Chrome 130 on Windows 10

Operating System (check https://whatsmyos.com)

Windows 10* 64-bit

andygup commented 2 weeks ago

Hi @Apesosmarc for questions about SDK functionality such as WebTileLayer, we recommend closing this issue and posting your question on the community site for the most visibility: https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/bd-p/arcgis-api-for-javascript-questions