Welcome to the JS API!Can you provide further information on exactly what is going wrong? Are you able to link to your site?There are a few potential problems in your code. Minor errors include:var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://xxxxxxxxx/ArcGIS/rest/services/Hillshade/MapServer");
map.addLayer(dynamicMapServiceLayer);
var dynamicMapServiceLayer = new esri.layers.ArcGISDynamicMapServiceLayer("http://xxxxxxxxx/ArcGIS/rest/services/WaterBodies_WebMercatorAux/MapServer",{"opacity":0.9});
map.addLayer(dynamicMapServiceLayer);
Without a unique name, you won't be able to do anything further with these layers. It would be better to name them uniquely.dojo.connect(map, 'onLoad', function(theMap) {
//resize the map when the browser resizes
dojo.connect(dijit.byId('map'), 'resize', map,map.resize);
});
dojo.connect(map,"onLoad",mapReady);
These should be conflated into a single function.However, I think your main problem is here:function onDrawEnd(extent){
toolBar.deactivate();
executeIdentifyTask(extent);
executeIdentifyTask is expecting a point location, and you've given it a rectangular extent. When you use the line:
clickHandler = dojo.connect(map, "onClick", executeIdentifyTask);
the onClick handler passes the point clicked by the user. This is what the identifyTask is expecting:
function executeIdentifyTask(geom) {
identifyParams.geometry = geom;
Hope this helps,Steve