<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic WebTileLayer Hosted Tile Server 204 No-Content Response in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-hosted-tile-server-204-no-content/m-p/1547146#M85851</link>
    <description>&lt;P&gt;I am creating a WebTileLayer pointing to a hosted tile server using the &lt;A title="urlTemplate" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate" target="_self"&gt;urlTemplate&lt;/A&gt;&amp;nbsp;property. The server returns tiles as expected.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;This may be the expected behavior however it seems redundant to have&amp;nbsp;to return blank png data to the client on each tile that is not available.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Question:&amp;nbsp;&lt;/STRONG&gt;Is there a way to avoid this error when receiving a 204, without having to return a blank.png on every response?&lt;/P&gt;&lt;P&gt;Rendering Error in Browser Console:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "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
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;General Response From Server:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;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&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core version -&lt;/STRONG&gt; 4.30.9&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Framework and build tools -&amp;nbsp;&lt;/STRONG&gt;React, Vite, Typescript&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;Expected behavior -&amp;nbsp;&lt;/STRONG&gt;WebTileLayer gracefully handles 204 response by rendering a blank tile without error.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Reproduce the issue -&amp;nbsp;&lt;/STRONG&gt;&lt;A href="https://codesandbox.io/p/sandbox/x7jt94?file=%2Findex.html%3A1%2C1-57%2C1" target="_blank"&gt;https://codesandbox.io/p/sandbox/x7jt94?file=%2Findex.html%3A1%2C1-57%2C1&lt;/A&gt;&lt;BR /&gt;URL can point to a simple local server that returns 204.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2024 16:05:05 GMT</pubDate>
    <dc:creator>mja24</dc:creator>
    <dc:date>2024-10-09T16:05:05Z</dc:date>
    <item>
      <title>WebTileLayer Hosted Tile Server 204 No-Content Response</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-hosted-tile-server-204-no-content/m-p/1547146#M85851</link>
      <description>&lt;P&gt;I am creating a WebTileLayer pointing to a hosted tile server using the &lt;A title="urlTemplate" href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-WebTileLayer.html#urlTemplate" target="_self"&gt;urlTemplate&lt;/A&gt;&amp;nbsp;property. The server returns tiles as expected.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;This may be the expected behavior however it seems redundant to have&amp;nbsp;to return blank png data to the client on each tile that is not available.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Question:&amp;nbsp;&lt;/STRONG&gt;Is there a way to avoid this error when receiving a 204, without having to return a blank.png on every response?&lt;/P&gt;&lt;P&gt;Rendering Error in Browser Console:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
    "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
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;General Response From Server:&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;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&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/642472"&gt;@ArcGIS&lt;/a&gt;/core version -&lt;/STRONG&gt; 4.30.9&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Framework and build tools -&amp;nbsp;&lt;/STRONG&gt;React, Vite, Typescript&lt;BR /&gt;&lt;STRONG&gt;&lt;BR /&gt;Expected behavior -&amp;nbsp;&lt;/STRONG&gt;WebTileLayer gracefully handles 204 response by rendering a blank tile without error.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Reproduce the issue -&amp;nbsp;&lt;/STRONG&gt;&lt;A href="https://codesandbox.io/p/sandbox/x7jt94?file=%2Findex.html%3A1%2C1-57%2C1" target="_blank"&gt;https://codesandbox.io/p/sandbox/x7jt94?file=%2Findex.html%3A1%2C1-57%2C1&lt;/A&gt;&lt;BR /&gt;URL can point to a simple local server that returns 204.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2024 16:05:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/webtilelayer-hosted-tile-server-204-no-content/m-p/1547146#M85851</guid>
      <dc:creator>mja24</dc:creator>
      <dc:date>2024-10-09T16:05:05Z</dc:date>
    </item>
  </channel>
</rss>

