ArcGIS Online API Javascript - toggle layer visibility

Discussion created by bartlingmona on Mar 30, 2014
Latest reply on Mar 30, 2014 by bartlingmona
Hey everyone,

I have a webmap on ArcGIS Online (I dont use ArcGIS Server) and would like to create an application with js. This, I already was able to do. However, I am wondering how it is possible to toggle the layer visibility. I read the tutorial how to toggle layers provided by ArcGIS. Anyway, it uses the expression "ArcGISDynamicMapServiceLayer.setVisibleLayers()". But I cant use this expression when I just uploaded a map to ArcGIS Online and I use this webmap in js right? I dont have a direkt URL to the layers of the webmap. Havent found a solution how to toggle the layer visibility. Would be glad to get some hints.