<?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 Re: Old Tiles Remain Drawn with client-side Rendering on BaseTileLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1291820#M81226</link>
    <description>&lt;P&gt;HI there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want to let you know that we i&lt;SPAN&gt;mproved the behavior of&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html" rel="nofollow" target="_blank"&gt;BaseTileLayer&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;to release the tiles that are no longer displayed at 4.27.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You can test this behavior on our &lt;A href="https://github.com/Esri/feedback-js-api-next/blob/main/CHANGELOG.md" target="_self"&gt;next version&lt;/A&gt;. This codepen shows the new behavior:&amp;nbsp; &lt;A href="https://codepen.io/U_B_U/pen/vYVGKwp?editors=1000" target="_blank"&gt;https://codepen.io/U_B_U/pen/vYVGKwp?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 22 May 2023 20:10:52 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2023-05-22T20:10:52Z</dc:date>
    <item>
      <title>Old Tiles Remain Drawn with client-side Rendering on BaseTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1277457#M80835</link>
      <description>&lt;P&gt;I have been working on setting up client-side rendering for Raster-based layers. I've created a customized &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html" target="_self"&gt;BaseTileLayer&lt;/A&gt; where I can change the filter of the data client-side. However sometimes old tiles of data persist.&lt;/P&gt;&lt;H3&gt;Example:&lt;/H3&gt;&lt;P&gt;&lt;A href="https://codepen.io/ryansutc/pen/wvYamLB?editors=1010" target="_self"&gt;This codepen&lt;/A&gt; is a rough example that demonstrates the issue.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="artifactIssue.gif" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/67688iAF8F17F7A09F6648/image-size/medium?v=v2&amp;amp;px=400" role="button" title="artifactIssue.gif" alt="artifactIssue.gif" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Set threshold to something like 3400. Zoom in a bit. Set threshold to 400. Zoom out. See old filter applied still for certain tiles.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;This is not a new issue. I initially &lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-to-customize-a-tilelayer-with-a-custom-source/m-p/1153221#M76630" target="_self"&gt;noted this problem here&lt;/A&gt; in another post. I also posted about similar problems occuring when changing the colors client-side on a renderer for a &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryTileLayer.html" target="_self"&gt;ImageryTileLayer.&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've raised the issue to ESRI Technical support but we were unable to resolve the issue. At that time I thought it would be sufficient for my needs to ensure that the MapView was fully drawn and stationary before letting the user adjust the styles. But that turns out not to be acceptable from a client standpoint.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Does anyone know if there is something that can be done to prevent this while still allowing client-side rendering and adjustments?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 17:54:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1277457#M80835</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2023-04-11T17:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Old Tiles Remain Drawn with client-side Rendering on BaseTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1291820#M81226</link>
      <description>&lt;P&gt;HI there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just want to let you know that we i&lt;SPAN&gt;mproved the behavior of&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-BaseTileLayer.html" rel="nofollow" target="_blank"&gt;BaseTileLayer&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;to release the tiles that are no longer displayed at 4.27.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You can test this behavior on our &lt;A href="https://github.com/Esri/feedback-js-api-next/blob/main/CHANGELOG.md" target="_self"&gt;next version&lt;/A&gt;. This codepen shows the new behavior:&amp;nbsp; &lt;A href="https://codepen.io/U_B_U/pen/vYVGKwp?editors=1000" target="_blank"&gt;https://codepen.io/U_B_U/pen/vYVGKwp?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 May 2023 20:10:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1291820#M81226</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-05-22T20:10:52Z</dc:date>
    </item>
    <item>
      <title>Re: Old Tiles Remain Drawn with client-side Rendering on BaseTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1292378#M81242</link>
      <description>&lt;P&gt;I just tested your code pen but I am still able to reproduce the problem I demonstrated above. Or at least there seems to be tiles not drawing correctly. Here is a video:&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thresholdCacheIssue.gif" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/71500i2CFF0B9DE118E2F0/image-size/large?v=v2&amp;amp;px=999" role="button" title="thresholdCacheIssue.gif" alt="thresholdCacheIssue.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 00:03:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1292378#M81242</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2023-05-24T00:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Old Tiles Remain Drawn with client-side Rendering on BaseTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1292579#M81247</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not able to reproduce the issue you are seeing. Which browser are you using?&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 15:02:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1292579#M81247</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2023-05-24T15:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Old Tiles Remain Drawn with client-side Rendering on BaseTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1292778#M81250</link>
      <description>&lt;P&gt;The video was from Firefox. Note that it is import to return to your initial zoom extent. You want to zoom in, say 4x, then zoom back out 4x to return to the initial zoom level. I probably should have added a zoom element displayed in the codepen to show that.&lt;BR /&gt;&lt;BR /&gt;I wasn't able to reproduce the problem every time. If I changed the threshold and waited for a few seconds too long before zooming I did not seem to get the issue. Also note there it looks like there are tiles that aren't drawing at all now whereas my initial example where we'd see the old filtered tile data remain?&lt;/P&gt;&lt;P&gt;At the office here I was eventually able to reproduce the issue (ff) though it too a few tries.&lt;/P&gt;&lt;P&gt;In Chrome the only way I was able to reproduce in the office now, is if I throttle the network speed. Then the problem is really easy to reproduce in your example (missing tiles, not old cached tiles). Try setting the network to 'Fast3G' to see what I mean.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Its certainly tricky though. Let me know if there's anything else I can do. Thanks for looking into.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2023 19:40:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1292778#M81250</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2023-05-24T19:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: Old Tiles Remain Drawn with client-side Rendering on BaseTileLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1375151#M83476</link>
      <description>&lt;P&gt;A very late response to an old post, but the trick I recently found that, so far, has gotten around this problem well is to hold off calling .refresh until after the layer has finished loading:&lt;BR /&gt;&lt;BR /&gt;So the setThreshold function in the codepen becomes something like:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;function layerCompletelyDrawnAndVisible(layer, view) {
  let [watchUtils] = await loadModules(["esri/core/reactiveUtils"]);
  let layerView = await view.whenLayerView(layer);
  let layerId = await new Promise((resolve) =&amp;gt; {
    if (layerView.updating) {
      watchUtils.when(
        () =&amp;gt; !layerView.updating,
        () =&amp;gt; {
          return resolve(layer.id);
        },
        {
          once: true,
        }
      );
    } else return resolve(layer.id);
  });
  return layerId;
}

function setThreshold() {
    thresholdVal = parseInt(threshold.value);

    let { colors, stops } = getRasterStopsAndColors(
      5000,
      thresholdVal,
      seedColors
    );
    //lercLayer.max = 3000;
    lercLayer.threshold = thresholdVal;
    lercLayer.stops = stops;
    lercLayer.colors = colors;

    //lercLayer.refresh();
    layerCompletelyDrawnAndVisible(lercLayer, view).then(v =&amp;gt; lercLayer.refresh())
  }
  // &lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/69004"&gt;@ts&lt;/a&gt;-ignore
  threshold.addEventListener("change", setThreshold);&lt;/LI-CODE&gt;&lt;P&gt;that seems to deal with the problem nicely!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jan 2024 00:49:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/old-tiles-remain-drawn-with-client-side-rendering/m-p/1375151#M83476</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2024-01-27T00:49:23Z</dc:date>
    </item>
  </channel>
</rss>

