Select to view content in your preferred language

map popupwindow events

970
2
05-04-2017 01:45 AM
ChristineFløysand1
New Contributor

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:

  • The user now has to open the Identify widget before the map popups are turned off.
  • When making the webmap, - if turning off the popups on all layers - the onSetFeatures and OnClearFeatures events won't fire

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?

 

0 Kudos
2 Replies
RobertScheitlin__GISP
MVP Emeritus

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.

ChristineFløysand1
New Contributor

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.