<?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: Vector tile layer not retaining current map extent in ArcGIS JS 4.0 in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/vector-tile-layer-not-retaining-current-map-extent/m-p/111503#M10371</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would be a bug in 4.0. You can currently work around the issue by setting the view.extent to itself immediately after setting the visibility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(layersElement, ".layers-item:click", function(e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var node = document.querySelector(".layers-item");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; node.classList.toggle("visible-layer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tileLyr.visible = !tileLyr.visible;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // add this line
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; view.extent = view.extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 06:41:08 GMT</pubDate>
    <dc:creator>ReneRubalcava</dc:creator>
    <dc:date>2021-12-11T06:41:08Z</dc:date>
    <item>
      <title>Vector tile layer not retaining current map extent in ArcGIS JS 4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/vector-tile-layer-not-retaining-current-map-extent/m-p/111502#M10370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;We have found this issue where if have multiple layers (including a vector layer) on the map and if we do the following, the current map extents are not applied to the vector layer:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Disable vector tile layer (set visible property to false).&lt;/LI&gt;&lt;LI&gt;Pan the map.&lt;/LI&gt;&lt;LI&gt;Enable the vector tile layer.&lt;/LI&gt;&lt;LI&gt;New map extents are not applied to the vector tile layer.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is a JS fiddle where you can try this out: &lt;A href="https://jsfiddle.net/qp1o3axz/" title="https://jsfiddle.net/qp1o3axz/"&gt;JSFiddle&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a workaround/fix to this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As we require multiple layers that can be enabled/disabled on the map for our project, it is critical for our project that we get this working.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 15:48:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/vector-tile-layer-not-retaining-current-map-extent/m-p/111502#M10370</guid>
      <dc:creator>MuktaPuri</dc:creator>
      <dc:date>2016-07-12T15:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: Vector tile layer not retaining current map extent in ArcGIS JS 4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/vector-tile-layer-not-retaining-current-map-extent/m-p/111503#M10371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This would be a bug in 4.0. You can currently work around the issue by setting the view.extent to itself immediately after setting the visibility.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; on(layersElement, ".layers-item:click", function(e) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var node = document.querySelector(".layers-item");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; node.classList.toggle("visible-layer");
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tileLyr.visible = !tileLyr.visible;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // add this line
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; view.extent = view.extent;
&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:41:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/vector-tile-layer-not-retaining-current-map-extent/m-p/111503#M10371</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2021-12-11T06:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: Vector tile layer not retaining current map extent in ArcGIS JS 4.0</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/vector-tile-layer-not-retaining-current-map-extent/m-p/111504#M10372</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank You! That worked!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2016 18:19:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/vector-tile-layer-not-retaining-current-map-extent/m-p/111504#M10372</guid>
      <dc:creator>MuktaPuri</dc:creator>
      <dc:date>2016-07-12T18:19:42Z</dc:date>
    </item>
  </channel>
</rss>

