I just switched from 4.18 to 4.19 and discovered that both DistanceMeasurement2D & AreaMeasurement2D appear to be broken or changed. Is this a bug or was this method removed? The code example worked as far back as 4.7.
let activeWidget = new AreaMeasurement2D({
view: view,
unit: "square-us-feet"
});
try {
activeWidget.viewModel.newMeasurement();
} catch (error) {
console.log(error);
// TypeError: activeWidget.viewModel.newMeasurement is not a function
}
// including
Solved! Go to Solution.
The .newMeasurement() function was renamed to .start()
The .newMeasurement() function was renamed to .start()
The renamed method Jethro mentions is documented along with many other Breaking Changes in the release notes.