I have added DistanceMeasurement2D & AreaMeasurement2D tools to the ArcGIS map. I need to round the measurement value into a single decimal place (default two decimal places). Following is the relevant code snippet,
Further, Are there any strategies to make measurements more accurate?
const distanceMeasurement2D = new DistanceMeasurement2D({
viewModel: {
view: view,
unit: "kilometers",
},
container: distancemeasureContainerRef.current!,
});
const areaMeasurement2D = new AreaMeasurement2D({
view: view,
container: areameasureContainerRef.current!,
});
const clearMeasurement = () => {
distanceMeasurement2D.viewModel.clear();
areaMeasurement2D.viewModel.clear();
};
clearButton.current?.addEventListener("click", clearMeasurement);
Following is the UI of the measurement,