AnsweredAssumed Answered

How to remove a layer from the Legend widget in Developer Addition Web App Builder?  We are programmatically adding a Grid layer to the map using JavaScript API, not the Web Map, and would like to hide the layer from the Legend Widget when we add this lay

Question asked by centerlinemapping on Oct 25, 2017
Latest reply on Nov 14, 2017 by Mehretab

How to remove a layer from the Legend widget in Developer Addition Web App Builder? We are programmatically adding a Grid layer to the map using JavaScript API, not the Web Map, and would like to hide the layer from the Legend Widget when we add this layer to the map.

 

This is how we add the layer to the map in the application:

var grid = new ArcGISDynamicMapServiceLayer("<mapserver>", {
          "opacity" : 1.0,
          "imageParameters" : imageParameters
        });
        
        this.map.addLayer(grid);
        grid.setVisibility(false);

 

Upon clicking a checkbox, the layer is set to visible = true.  We would like for this layer not to be added to the Legend widget as it is a simple 1 x 1 grid of the globe. 

 

Thank you for your time.

Outcomes