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.
var depthButton = new dijit.form.Button({
id: "depth",
iconClass: "depthIcon",
onClick: function(){
navControls.deactivate();
getDepth();
}
});
navToolbar.addChild(depthButton);
new dijit.Tooltip({connectId:["depth"], label: "Identify Depth of SLR model at a Point"});
function getDepth(){
identifyTask = new esri.tasks.IdentifyTask("http://servergoeshere/ArcGIS/rest/services/slr/MapServer");
identifyParams = new esri.tasks.IdentifyParameters();
identifyParams.tolerance = 3;
identifyParams.layerIds = [1];
map.infoWindow.resize(100, 70);
map.infoWindow.setTitle("Depth");
identHandle = dojo.connect(map, "onClick", doIdentify);
}
function showDepth(result, evt) {
value = result[0].value;
meters = Math.round(result[0].value*100)/100;
feet = Math.round(result[0].value*3.2808399*100)/100;
map.infoWindow.setContent(meters + " m <br>" + feet + " ft");
map.infoWindow.show(evt.screenPoint, map.getInfoWindowAnchor(evt.screenPoint));
}
var deactivateButton = new dijit.form.Button({
id: "deactivate",
iconClass: "deactivateIcon",
//label: "Cancel",
onClick: function(){
navControls.deactivate();
dojo.disconnect(identHandle);
}
});
navToolbar.addChild(deactivateButton);
new dijit.Tooltip({connectId:["deactivate"], label: "Deactivate Selected Control"});