Is there a way to display length when you are drawing?

2630
3
06-16-2011 09:57 PM
DanDong
New Contributor
Hi guys,

I use draw class in my application to draw polygons. Is there a way to display the length automatically when you are drawing? Just like what it is in the measure action, a segment length and a total length are showing as you move the mouse.

I know geometry service can be used to calculate the length, but that must happen after you finish drawing.

Any ideas or thoughts? Thank you 🙂
0 Kudos
3 Replies
JenniferNery
Esri Regular Contributor
You have to use MeasureAction if you need the length to show. This is not supported by Draw out-of-the-box, but you can maybe create a symbol with TextBlock bound to an attribute and update this attribute on MouseMove to show the length from MouseLeftButtonDown to MouseLeftButtonUp.
0 Kudos
RyanDanford
New Contributor
shirleydd,

This can be done without the Measure Action that Jennifer mentioned.

Sometime back, ESRI released the source for the measure action on codeplex and within this action were several classes for measuring distance/area in real time.  You should be able to extract the needed code from the action and apply your own implementation with some experimenting.
0 Kudos
tanyabisen
New Contributor
hi.. I need to work on d same issue... Is der any sample available or any link from where I can get the idea.. but I am working on Flex API
0 Kudos