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.
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?