arcgislink/examples/simpleags.js
function setLayerVisibility() {
  var layers = svc.layers;
  for (var i = 0; i < layers.length; i++) {
    var el = document.getElementById('layer' + layers[i].id);
    if (el) {
      layers[i].visible = (el.checked === true);
    }
  }
  ov.refresh();
}
function setLayerVisibility() {
  var layers = svc.layers;
  for (var i = 0; i < layers.length; i++) {
    var el = document.getElementById('layer' + layers[i].id);
    if (el) {
      layers[i].visible = (el.checked === true);
    }
  }
  ov.refresh();
}
function setLayerVisibility ( ) { var layers = svc . layers ; for ( var i = 0 ; i < layers . length ; i ++ ) { var el = document . getElementById ( 'layer' + layers [ i ] . id ) ; if ( el ) { layers [ i ] . visible = ( el . checked === true ) ; } } ov . refresh ( ) ; }
Check the visibility of layers and refresh map
Check the visibility of layers and refresh map