Hello,
I'm trying to update the layers available for a custom widget. The layers needed are those in the layerList checked and I would like to update the information every time the user check or uncheck a layer. I tried to use the LayerInfosObject and catch the layerInfosIsVisibleChanged or the layerInfosIsShowInMapChanged events, however I've observed a very weir behavior.
I have to types of layers, those are in the webmap and those uploaded with the Add Data widget. For the layers included in the webmap it's fine, when I check or uncheck the layer an event is trigger. The problem raise with the other layers where the number of events depends on the order when the layer was uploaded.