How to show segment length on AreaMeasurement2D?

573
2
09-09-2021 09:06 AM
AdamNull
New Contributor

I'm trying to use the AreaMeasurement2D widget in the ArcGIS API for JavaScript version 4.20. When using this widget, it will only show total perimeter length and this is after you have placed a second point. However, in the AreaMeasurement3D widget, after you place the first point, it will dynamically show the segment length as you are drawing and it also displays the previous segment length.

Using the AreaMeasurement2D widget, as soon as you place the first point, is there anyway I can dynamically show the segment length?

0 Kudos
2 Replies
Noah-Sager
Esri Regular Contributor

Hi @AdamNull, thanks for posting here. I don't think this ability is currently possible. However, this is an enhancement we'd like to consider for a future release. Will update this thread when there is an update to share.

0 Kudos
AdamNull
New Contributor

That sounds great, thank you. In the meantime (for anyone interested), I found a workaround solution using both the Draw and Geometry Engine functionality. I allow users to draw a polygon and on a 'cursor-update' event (i.e. the user moves their mouse), I create a polyline using the latest added vertex and the XY location of the cursor (which is in the cursor-update event) as input points. Then, I use the geometry engine to calculate the planar length of that polyline. This method is quick enough that the segment length seems to be dynamic and live.