AnsweredAssumed Answered

Render all visible feature layers in a map invisible with click of element

Question asked by john_richardson_1969 on Oct 30, 2018
Latest reply on Nov 1, 2018 by john_richardson_1969

I am struggling with this most basic operation ... please help!

 

Here is code snippet I am working with :

      $("#grayPic").click(function() { //eventually, this will render all layers in the map invisible
      var allGuys = map.allLayers;
      var i, currentLayer;
      for (i = 0, l = allGuys.length; i < l; i++) {
      currentLayer = allGuys[i];
      currentLayer.visible = false;
      };
      });

Outcomes