Is there a specific event or location that I can include a code to display for example a message, every time the legend widget is updated?
Example: I've included an alert on the "onOpen" function of the legend widget. It works perfectly, but logically, only when the widget is reopened. What I need is that whenever the legend widget is updated, for example, when the zoom of the map is modified and other layers are displayed, that same message is displayed.
I tried to include the code inside the "refreshLegend" function, but I did not succeed.
I also debugged the zoomslider widget, but I also did not find where the legend widget is updated.
Thanks for any help.