Hello,
I'm currently facing some challenges related to monitoring changes in layer visibility within map layers and custom widgets I've developed.
I've discovered that I can access the '__esri.LayerList' to interact with the visibility function for the layers within my map layers widget. However, I'm encountering issues with implementing the visibility toggle, as it seems to override the normal function. Additionally, I'm struggling with identifying which specific layer was selected for showing or hiding.
this.layerList._toggleVisibility = function (pointerEvent: PointerEvent) {
console.log(pointerEvent)
}
I'd greatly appreciate any recommendations or insights on how to effectively track changes in layer visibility.
Thank you in advance for your help!