songissimo

Layer Visibility Enable/Disable

Discussion created by songissimo on Mar 26, 2012
Latest reply on Apr 19, 2012 by rebeccarothbard1
Hi everybody,
   after many tests I'm not able to show or hide layer provided by a rest service using this example http://resources.esri.com/help/9.3/arcgisserver/apis/javascript/arcgis/help/jssamples_start.htm#jssamples/map_explicitlayerlist.html


function updateLayerVisibility() {
        var inputs = dojo.query(".list_item"), input;
        //in this application layer 2 is always on.
        visible = [2];
        for (var i=0, il=inputs.length; i<il; i++) {
          if (inputs[i].checked) {
            visible.push(inputs[i].id);
          }
        }
        layer.setVisibleLayers(visible);
      }

It doesn't seems to affect the visibility of any layer.

Any suggestions?

Thanks everybody.

Outcomes