Solved! Go to Solution.
dojo.connect(map, "onClick", executeIdentify);
var identifyHandle = dojo.connect(map, "onClick", executeIdentify); // later, when your measure button is clicked: dojo.disconnect(identifyHandle);
Hi Chris,
Disconnect your event listener that runs your identify when the measure button is clicked. I haven't dug into your code but somewhere you probably do:dojo.connect(map, "onClick", executeIdentify);
dojo.connect returns a handle to the event listener you can use to later disconnect the event like so:var identifyHandle = dojo.connect(map, "onClick", executeIdentify); // later, when your measure button is clicked: dojo.disconnect(identifyHandle);
When the measure widget is deactivated, you can re-connect your identify listener.
I uploaded a revised version of the application that includes a connect and disconnect. It still does not disconnect.
There is a variable identifyHandle at the top, a dojo.connect when the map loads and then I created another connect for the identify button and a disconnect for the measure button.
Chris,
Your code is fairly complicated and it'll take time to trawl through it looking for the right sections. Can you make it a bit easier by highlighting in which files the variables are set?
Cheers,
Steve
Hello,
Within your init() function you are setting the onclick event of the map to fire the doIdentify(). I disabled that and the operations seemed to function in the way you wished. However, I did have to click the Identify tool to get it to recognize that it needed to identify items. I haven't looked in to it much further, but thought I would share. This might not work for you if you are wanting to set the identify as the primary task. I will look further tomorrow unless someone else with more experience helps you out first.
Best wishes,