Hi, I am developing an "Identify" widget that will display information about clicked features in the map. This widget is resizable and can be moved around in the map, and is supposed to be an alternative to the map.infoWindow that is not resizable and not movable.
When my widget is started the first time I set the default popup to not show:
this.map.infoWindow.set("popupWindow", false);
Then I set up the widget to listen to the "onSetFeatures" and "onClearFeatures" events of the map.popup window.
This works perfectly fine, but has several limitations:
What I want to achieve is that I want to have my Identify widget working properly whether or not all popups are turned off in the webmap.
Will this mean that I have to implement the widget in an other way that listening to the events from the popup window?
Christine,
Here is my input to your issues:
1. You need to set this.map.infoWindow.set("popupWindow", false); in your apps code and not in your widgets code.
2. Yes if you are going to disable all popups in the web map then there will be no popup events for your widget to use, so you will have to do an IdentifyTask or QueryTask on map click instead.
Thanks Robert. Attaching to the popup events went fast and was a neat solution, but I want my widget to be independent of whether the popups are disabled or not. So I will reimplement my widget to use QueryTask.