This works very well to deactivate the measure tool--I am trying to use it to deactivate the measure tool when an identify button is toggled. However, I'm getting some conflict with the identify handler I'm using. The code below starts and pauses the identify handler when the identify button is toggled (identify does not work and console prints out "Identify started" followed by "Identify paused". Can anyone see why this may be happening with the code posted below?
var idButton = new ToggleButton({
label: "Identifier les entités",
showLabel: false,
iconClass: "identifyIcon",
checked: false,
onChange: function (val) {
if (val) {
window.idHandler = on.pausable(window.myMap, "click", runIdentifies); //runIdentifies is the identify function
console.log("Identify started");
measurementActiveButton = dojo.query(".esriMeasurement .esriButton.esriButtonChecked .dijitButtonNode")[0]
if(measurementActiveButton){
measurementActiveButton.click();
}
}
else {
window.idHandler.pause();
console.log("Identify paused");
}
}
}, "id_button");
idButton.startup();