newMeasurement bug or removed in 4.19

874
2
Jump to solution
06-15-2021 03:04 PM
GregoryBologna
Occasional Contributor II

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.

Example (works in 4.18)
 

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

https://js.arcgis.com/4.19

1 Solution

Accepted Solutions
JethroLeevers
Occasional Contributor

The .newMeasurement() function was renamed to .start()

View solution in original post

2 Replies
JethroLeevers
Occasional Contributor

The .newMeasurement() function was renamed to .start()

EthanBodin1
New Contributor III

The renamed method Jethro mentions is documented along with many other Breaking Changes in the release notes.