Jonathan
Thanks for that, my code now looks like
measurement.on("measure-end", function (evt) {
console.debug(evt)
if (evt.geometry.type === "polygon") {
console.log("Really done.");
}
});
But it fails - looking at the evt object (hence my console line) it is, as I thought it would be, a polygon after three nodes have been drawn - output below, first is after a single click (ie still drawing), second after a double click
Really done. basecode.js?123:254
Really done.
And adding the line I want in
this.setTool(evt.activeTool, false);
Throws a huge error, starting
"TypeError: undefined is not a function
Only reverting to the older style event link
dojo.connect(measurement, "onMeasureEnd", function (activeTool, geometry) {
console.debug(activeTool);
console.debug(geometry);
this.setTool(activeTool, false);
enableID();
});
gets the tool disabled - but of course it disables as soon as the third node is created. And geometry type is always polygon.
Would adding a Double Click event be too much to ask?
Cheers
ACM