Thanks Derek for getting back to me.Here is the code that activates the measurement widget.
//Measure button click handler.
function MeasureBtnClickHandler()
{
doIdentify = false;
if (dijit.byId('dFloatingPane02').open==false)
{
createMeasure();
this.navToolbar.deactivate(); //I am calling this method as you mentioned
}
}
//CreateMeasure function
function createMeasure()
{
measurement = new esri.dijit.Measurement({
map: map
}, dojo.create('measure'));
dojo.place(measurement.domNode,dojo.byId('measurementDiv'));
measurement.startup();
dijit.byId('dFloatingPane02').show();
dijit.byId('dijit_DialogUnderlay_0').hide();
}
Just calling navToolbar.deactivate() was doing nothing.So, I am calling disable methods on map (as mentioned in my earlier post). When user clicks on NavToolbar Tool like Zoom in/out or pan, I calling following method to destroy the measurement widget.
function tglMeasurementOff() {
measurement.destroy();
dijit.byId('dFloatingPane02').hide();
//map.enableMapNavigation()();
}
Even, when Measurement panel is closed by user, I am calling the tglMeasurementOff() method.I tried to call following function to deactivate the measurement, but it was giving me issues while doing Identify.
//When any navigation tool is clicked, following method is called.
function DeactivateMeasure()
{
measurement.setTool("location",false);
measurement.setTool("area",false);
measurement.setTool("distance",false);
}
If you need any further information, please let me know. Thanks.