<?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: Add feature layer back to map after removing it in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layer-back-to-map-after-removing-it/m-p/291845#M26785</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ESRI support confirmed that this is a bug in the JavaScript API.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 May 2020 16:35:54 GMT</pubDate>
    <dc:creator>ZianChoy</dc:creator>
    <dc:date>2020-05-19T16:35:54Z</dc:date>
    <item>
      <title>Add feature layer back to map after removing it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layer-back-to-map-after-removing-it/m-p/291844#M26784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I removed a feature layer with a heatmap renderer in the latest version of the 3.x JS API, nothing appeared in the map after adding it back.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;You can reproduce the problem by going to &lt;A class="link-bare" href="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=renderer_heatmap_weighted" title="https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=renderer_heatmap_weighted"&gt;https://developers.arcgis.com/javascript/3/sandbox/sandbox.html?sample=renderer_heatmap_weighted&lt;/A&gt;&amp;nbsp; and making a tweak to the valCtrl.addEventListener function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Insert the following as the first line in the function:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.removeLayer(heatmapFeatureLayer);&lt;/P&gt;&lt;P&gt;And put this line right above the call to redraw():&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; map.addLayer(heatmapFeatureLayer);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, click the refresh button and try moving a slider or unchecking a checkbox in the map. Nothing will appear in the map.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my real application, I have ~6 different groups of layers that get swapped in and out of the map depending on the displayed attribute. For instance, 1 group might show the "Geocoder" string attribute with only 1 layer and another group might show a "Derived Number" attribute with 3 layers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What would be the best way to overcome this bug in the JS API?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 May 2020 07:13:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layer-back-to-map-after-removing-it/m-p/291844#M26784</guid>
      <dc:creator>ZianChoy</dc:creator>
      <dc:date>2020-05-07T07:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: Add feature layer back to map after removing it</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layer-back-to-map-after-removing-it/m-p/291845#M26785</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;ESRI support confirmed that this is a bug in the JavaScript API.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 May 2020 16:35:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/add-feature-layer-back-to-map-after-removing-it/m-p/291845#M26785</guid>
      <dc:creator>ZianChoy</dc:creator>
      <dc:date>2020-05-19T16:35:54Z</dc:date>
    </item>
  </channel>
</rss>

