AnsweredAssumed Answered

After grouping layers in the layerlist widget the legend widget does not work

Question asked by gilbertorm83@gmail.com on Feb 21, 2017
Latest reply on Feb 23, 2017 by gilbertorm83@gmail.com

Hello!

 

I was able to group my layers in the layerlist widget as I needed it, but the problem is that now, for example, my legend widget always displays "No legends".

 

Running a debug, I realized that the operational layers of the map obviously are no longer in the standard object, but in the clustered one. However, I tried to modify the following lines in the legend widget, but I did not succeed.

 

...

this._jimuLayerInfos = LayerInfos.getInstanceSync();  //This line
var legendParams =
{
        arrangement: this.config.legend.arrangement,
        autoUpdate: this.config.legend.autoUpdate,
        respectCurrentMapScale: this.config.legend.respectCurrentMapScale,
        //respectVisibility: false,
        map: this.map,
        layerInfos: this._getLayerInfosParam() ////This line
};

...

 

 

For grouping the layers, finally, I used the tip contained in the link below.

 

https://community.esri.com/thread/174943

 

Thanks for the help.
Gilberto.

Outcomes