I am using the ESRI Javascript API 2.0 and Dojo dijits.
Does anyone know how to wire up a dojo button (or toggle button) in a toolbar to a mouse click event on the map?
I want the user to have to select a tool/button before clicking on the map and NOT just have the map listen to any old mouse click event as this is too open i.e. I want to constrain the functionality to the selecting a tool from the UI.
Best Answer
Here are the methods to disable the built-in map events like drag to pan, double-click to zoom.
Then you can use the navigation toolbar for some basic functionality and/or wire up your own custom controls using the map events
Here's a some example code for wiring a button up to a map onClick programatically, and a corresponding deactivate selected control button.