Select to view content in your preferred language

New Measurement component "state" value

187
0
04-08-2025 11:16 AM
Status: Open
Labels (1)
fdeters
Regular Contributor
What I'd like to see:
Update to "state" property of measurement components/widgets in the ArcGIS Maps SDK for JavaScript
 
Description of issue:
When using measurement widgets or components from the JS SDK, there is a missing "state" value that I would like to see added. The "state" property can currently have four values: "disabled", "ready", "measuring", and "measured". This set of state values does not cover the case when a user has clicked "New measurement" or otherwise entered measuring mode, but has not yet placed any points on the map. This state is important to capture, since the cursor is taken over for measurement. However, currently, the state does not change from "ready" to "measuring" until a point is placed.
 
Here is a codepen that will help with exploring the issue: https://codepen.io/fdeters/pen/MYWdExP. Follow these steps:
  1. Observe that the widget state is "ready".
  2. Click "New measurement". The widget state is still "ready", but the cursor is now taken over for measurement.
  3. Click on the map to place a measurement point. The widget state now turns to "measuring".
 
Ideally, there would be a state value to describe the state we are in after performing step #2, or the state would switch to "measuring" once step #2 is completed.
 
Use case:
In a custom web app, I have a tool in a tool panel that automatically activates the measuring widget when it is open. I want to display a visual indicator to the user that their cursor is taken over for measuring while the tool is open. There is currently no way to distinguish between when the tool is "ready" but the cursor is not taken over vs. when the tool is "ready" and the cursor is taken over.
 
Note:
Ideally, this change would make it into both the SDK widgets and the map components.