When my custom widget opens, I have a map onclick event enabled that turns on with no problem from a toggle button. The user then clicks on the map and gets some info based on the click. But I can't turn the functionality off again. When the button is toggled off the mapclick still works. Even after the widget container is closed, the mapclick event is still active.
I've tried using a handle with dojo.connect and dojo.disconnect but that hasn't worked for me.
Can someone help?
Basic widget stuff but I'm not getting it.