Hello!I have an issue with toggling the measurement widget: the first time i start the measurement it shows up and works correctly. Also destroying it works. But when I want to activate it another time the Div won't be displayed. What am I doing wrong?
var measurement;
...
if ((++clickcounter%2) == 0) {
measurement.destroy();
} else {
if (measurement == undefined) {
measurement = new esri.dijit.Measurement({
map: map,
defaultAreaUnit: esri.Units.SQUARE_METERS,
defaultLengthUnit: esri.Units.KILOMETERS
}, dojo.byId('measurementDiv'));
measurement.startup();
}
measurement.setTool("distance", true);
}
...
<div id = "measurementDiv"></div>