AnsweredAssumed Answered

Turn off visibility of line featurelayer

Question asked by kganz on Mar 12, 2014
Latest reply on May 5, 2014 by ressinger-esristaff
I'm putting together a self-hosted shortlist map for our Capital Improvment Program.
Can be found here temporarily

It has 2 point layers for the tabs and another layer of line features. The line features are from a hosted featureservice created from an uploaded shapefile. In the end I will use the line features so I can reduce the number of point locations in the Road Maintenance tab.

What I am trying to do is get a reference to that layer and conditionally turn its visibility off or on. I can loop through the operationalLayers like so to test:
var layers = response.itemInfo.itemData.operationalLayers;    for ( var x = 0; x < layers.length; x++){   alert(layers[x].id);   }

So the layer I am looking to hide or setVisibility to false shows up as layers[0] (shoes first in the alert statement) but I can't seem to get it to toggle off.

Thank you,