I am creating a WebTileLayer pointing to a hosted tile server using the urlTemplate property. The server returns tiles as expected.
However, when the requested tile is not available on the server I want to return a 204 - No Content response back to the client as this tile does not exist and I'd like to show a blank tile.
When doing this I receive a bunch of rendering errors stating that the source image could not be loaded even though it seems that the 204 network request is being accepted.
This may be the expected behavior however it seems redundant to have to return blank png data to the client on each tile that is not available.
Question: Is there a way to avoid this error when receiving a 204, without having to return a blank.png on every response?
Rendering Error in Browser Console:
{
"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
}
}
General Response From Server:
Request URL:
http://localhost:3030/maptiles/1696606342/grid2/r1/18/77690/98387.png
Request Method:
GET
Status Code:
204 No Content
Remote Address:
[::1]:3030
Referrer Policy:
strict-origin-when-cross-origin
@ArcGIS/core version - 4.30.9
Framework and build tools - React, Vite, Typescript
Expected behavior - WebTileLayer gracefully handles 204 response by rendering a blank tile without error.
Reproduce the issue - https://codesandbox.io/p/sandbox/x7jt94?file=%2Findex.html%3A1%2C1-57%2C1
URL can point to a simple local server that returns 204.