Nighteyez07

Measure segments while drawing polygon at same time

Discussion created by Nighteyez07 on May 17, 2013
Latest reply on May 18, 2013 by stevel
I've researched the samples, API, and general web to find any form of a solution to this but have come up dry. Is there a way to take the segments of a polygon as they are being drawn and display their measurement? I know that the measurement widget exists, however that's its own entity and separate from drawing a polygon. And so far I've been unable to find a method in which I can capture the current drawing object to run the geometry service against. Any suggestions or hints would be appreciated. If there was an event listener that could be attached which returned the current drawing object, I could then get the segment length from that, but I haven't seen anything of the sort.

Psuedocode:
Start Drawing
Show measurement window (a floating window)
Attach drawing object to variable
Move mouse to draw segments
Take drawing object variable and simplify using geometry service
Run a length check on the current segment to display length
Complete Drawing (onDrawEnd)
Measurement window disappears


Ideas?

Outcomes