Update Map Layers Javascript. 

Differentiate between tile layers and feature layers. Thanks Laurian! :).