I want to remove the click handler in my Pictometry widget if the user closes the widget. Regardless whether they've already clicked on the map. (I already have the covered, after the window.open(url), the next line is handlerPictometry.remove() ) Because currently the map.on 'click' handler stays active until the map is clicked on. I want to remove it when the widget closes.
Oddly enough Dojo docs do not talk about hooking to a widget closing.
I referred to Understanding _WidgetBase - Dojo Toolkit Tutorial and Writing Your Own Widget — The Dojo Toolkit - Reference Guide etc
But I found this useful thread, the aspect.after post: