Add feature layer back to map after removing it

05-07-2020 12:13 AM
Occasional Contributor

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.

You can reproduce the problem by going to  and making a tweak to the valCtrl.addEventListener function.

Insert the following as the first line in the function:


And put this line right above the call to redraw():


Then, click the refresh button and try moving a slider or unchecking a checkbox in the map. Nothing will appear in the map.

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.

What would be the best way to overcome this bug in the JS API?

0 Kudos
1 Reply
Occasional Contributor

ESRI support confirmed that this is a bug in the JavaScript API.

0 Kudos