code: 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();
  }
docs: Check the visibility of layers and refresh map