I have a map with a clickListener that is setup initially via map.on to handle the standard infoTemplate information for layers that are turned on in an info WIndow. When I try to put the measurement tool on my page (using 3.13) I use a .remove for the click listener when the tool opens and am able to do the measure events no problem.
However when the measure ends and I'm not sure if this should be when the close my form with the widget or on measure-end I am not able to re add my infoTemplate clickListener back in to show the info Window.
I've seen a couple of examples that use dojo aspect or dojo connect but I gather dojo connect and disconnect are old. I can't seem to hit on a good way to do it or figure out the placement. Does anyone out there have a working measurement/info swap method that works? I'm thinking I may have to scrap the requested measurement functionality if its not possible. I'm using bootstrap / jquery / 3.13 with some amount of dojo mixed in to use some of the easier esri widget items where needed.
Lo Wolhar,
However when the measure ends and I'm not sure if this should be when the close my form with the widget or on measure-end I am not able to re add my infoTemplate clickListener back in to show the info Window.
Can you show us the code that you are using for this?
Hi,
I had face the same issue and the solve was simple ..
I define a public Boolean variable and change the value each time I switch measurement On/Off to know the current click map mood ( Measurement vs. InfoWindow )
So, before show up the InfoWindow, you have to check if the mood is InfoWindow mood in a simple if statement ...
That will prevent the conflict of the click event handlers. And its works fine with us.
Hope this help you.
Regards,
Yusuf
You can use map.setInfoWindowOnClick to enable/disable info window clicks for the map. Here's an example that disables info windows when a measure tool is activated and re-enables them when the tool is deactivated.
query(".esriMeasurement .dijitButtonNode").on("click", lang.hitch(this, function(e){ var tool = measureWidget.getTool(); if(tool){ this.map.setInfoWindowOnClick(false); }else{ this.map.setInfoWindowOnClick(true); } }));