What events can be used to obtain the results measured by these tools, such as extent or area?
Solved! Go to Solution.
Thanks, for this interesting use case using reactiveUtils .
This is a fun use case for using reactiveUtils.
The AreaMeasurement3D has an analysis object with the geometry being drawn that you can watch for changes.
It also has a measurement object on the viewModel. So you can watch the area or the perimeterLength to get those values when using it. This is the displayed text for these, so not raw numbers, but looks like the results of the geometryEngine functions used on the analysis object.
watch(
// watch for the analysis geometry to update
() => activeWidget.analysis?.geometry,
() => console.log("analysis", activeWidget.analysis)
);
when(
// wait for the area text to be available
() => activeWidget.viewModel.measurement?.area.state === "available",
() => console.log(activeWidget.viewModel.measurement)
);
when(
// wait for the perimeter text to be available
() => activeWidget.viewModel.measurement?.perimeterLength.state === "available"
() => console.log(activeWidget.viewModel.measurement)
);
Thanks, for this interesting use case using reactiveUtils .