Robert,
That's not working like I want. Because, if I disable the infoWindow, the layer (that has enabled that popup) not listen that event. And the user will be confused.
So, is there some event listener to this? I want to know when the popup is enabled or disabled and when I disable that from checkbox widget the LayerList widget must know and the option 'disable popup' must change to 'enable popup' again like the begining.
Or also, when I enable a popup, the checkbox widget should change to disabled.
I think this problem can be solved by some of the above solutions.
Now I have this code:
if(this.map.infoWindow.isShowing){ //change to true if any popup is enabled
this.checkedFunction(false); //change the widget appearance
this.checkbox.set('checked', false); //uncheck checkbox
this.map.graphics.clear(); //erase the marker
this.map.setInfoWindowOnClick(false); //disable popup
return;
}
What do you think? or What do you know about this?