Hi,
I'm building an application that has the ability to perform measurement through the Measurement Tool along with identify functionality in 2.3 of the API. Both tools work with the map.click event. I understand the mechanics of how to stop an event so that for instance when the user clicks the map to perform an identify that it doesn't also perform a measurement. However, with the measure tools I don't see any exposed events that would allow me to stop an event. For example, when the user clicks the Measure Distance tool and then clicks the map to define the first point it also attempt to perform an identify and vice versa.
Anyone know how to handle this?
Thanks,
Eric Pimpler
GeoSpatial Training Services, Inc.
http://www.geospatialtraining.com
http://geochalkboard.wordpress.com
Thanks for the clue on Jian's post on http://forums.arcgis.com/threads/31664-How-to-modify-measurement-widget, it is feasible by code like this;
var clickMode =true; //globle variable. default as enable click event
....
dojo.connect(map, "onClick", doIdentify);
....
var measurement = new esri.dijit.Measurement({
map: map
}, dojo.byId('measurementDiv'));
measurement.startup();
var distanceBtn = dojo.query('[widgetid=\"distance\"]')[0];
dojo.connect(distanceBtn, "onclick", function() { //note: onclick not onClick
clickMode =false; //deactivate the click identify event
});
...
function doIdentify(evt)
{
if (!clickMode) return;
else
{
.... identify action go here;
clickMode =true; //reset back
}
}