<?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 Changing style of VectorTileLayer causes data to be fetched in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-style-of-vectortilelayer-causes-data-to/m-p/1572312#M86319</link>
    <description>&lt;P&gt;A colleague pointed out that, when you change the style for a VectorTileLayer in the JavaScript Maps SDK, the browser goes and fetches tiles of data for that layer.&lt;/P&gt;&lt;P data-unlink="true"&gt;You can see/reproduce this behavior when looking at the &lt;A href="https://codepen.io/U_B_U/pen/abgMmpq?editors=1000" target="_self"&gt;CodePen example&lt;/A&gt;&amp;nbsp; posted&amp;nbsp; by&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;in an &lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-errors-with-vectortilelayer-and/m-p/1544422#M85799" target="_self"&gt;earlier thread in this forum&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clicking a feature to change style causes fetches to server" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122635i1C414D89A0237E4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StyleChangeCausesFetches.gif" alt="clicking a feature to change style causes fetches to server" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;clicking a feature to change style causes fetches to server&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this to be expected? Is it possibly a bug?&lt;/P&gt;&lt;P&gt;I was about to implement this behavior with a "mouseover" event. This would cause it to fire quite frequently as the user moves their cursor around over various features (even with some &lt;A href="https://developer.mozilla.org/en-US/docs/Glossary/Debounce" target="_self"&gt;debouce&lt;/A&gt; handling). I wasn't expecting it to initiate any data fetches because it is just changing the color of an existing layer style.&lt;/P&gt;&lt;P&gt;[I can reproduce behavior running latest 4.31 version of the API].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jan 2025 00:21:37 GMT</pubDate>
    <dc:creator>RyanSutcliffe</dc:creator>
    <dc:date>2025-01-03T00:21:37Z</dc:date>
    <item>
      <title>Changing style of VectorTileLayer causes data to be fetched</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-style-of-vectortilelayer-causes-data-to/m-p/1572312#M86319</link>
      <description>&lt;P&gt;A colleague pointed out that, when you change the style for a VectorTileLayer in the JavaScript Maps SDK, the browser goes and fetches tiles of data for that layer.&lt;/P&gt;&lt;P data-unlink="true"&gt;You can see/reproduce this behavior when looking at the &lt;A href="https://codepen.io/U_B_U/pen/abgMmpq?editors=1000" target="_self"&gt;CodePen example&lt;/A&gt;&amp;nbsp; posted&amp;nbsp; by&amp;nbsp;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/53756"&gt;@UndralBatsukh&lt;/a&gt;&amp;nbsp;in an &lt;A href="https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-errors-with-vectortilelayer-and/m-p/1544422#M85799" target="_self"&gt;earlier thread in this forum&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="clicking a feature to change style causes fetches to server" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/122635i1C414D89A0237E4C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="StyleChangeCausesFetches.gif" alt="clicking a feature to change style causes fetches to server" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;clicking a feature to change style causes fetches to server&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this to be expected? Is it possibly a bug?&lt;/P&gt;&lt;P&gt;I was about to implement this behavior with a "mouseover" event. This would cause it to fire quite frequently as the user moves their cursor around over various features (even with some &lt;A href="https://developer.mozilla.org/en-US/docs/Glossary/Debounce" target="_self"&gt;debouce&lt;/A&gt; handling). I wasn't expecting it to initiate any data fetches because it is just changing the color of an existing layer style.&lt;/P&gt;&lt;P&gt;[I can reproduce behavior running latest 4.31 version of the API].&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 00:21:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-style-of-vectortilelayer-causes-data-to/m-p/1572312#M86319</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2025-01-03T00:21:37Z</dc:date>
    </item>
    <item>
      <title>Re: Changing style of VectorTileLayer causes data to be fetched</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-style-of-vectortilelayer-causes-data-to/m-p/1573323#M86345</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This is expected behavior. When calling &lt;EM&gt;setStyleLayer&lt;/EM&gt;, even if it modifies an existing layer—or adds a new one—the layer may have a different query or layout. As a result, we need to access the PBF (protocol buffer) and reprocess the features to ensure they align with the updated configuration. We fetch pbf for visible tiles.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 21:08:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-style-of-vectortilelayer-causes-data-to/m-p/1573323#M86345</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2025-01-07T21:08:25Z</dc:date>
    </item>
    <item>
      <title>Re: Changing style of VectorTileLayer causes data to be fetched</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-style-of-vectortilelayer-causes-data-to/m-p/1573375#M86346</link>
      <description>&lt;P&gt;Ah interesting thanks. I didn't think that queries or styling changes on the frontend would affect what was being fetched over the wire from the VectorTileServer. I figured it fetched everything as raw data and then drew what was needed according to whatever filters and/or styling rules were present on the ESRI layers.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jan 2025 22:32:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/changing-style-of-vectortilelayer-causes-data-to/m-p/1573375#M86346</guid>
      <dc:creator>RyanSutcliffe</dc:creator>
      <dc:date>2025-01-07T22:32:52Z</dc:date>
    </item>
  </channel>
</rss>

