Select to view content in your preferred language

Draw and Measure widget - live measure function

1679
1
09-27-2011 01:50 PM
StevenHaslemore
Regular Contributor
Hi,

I have added a live measure to the Draw and Measure widget for the line and polyline draw functions by adding mouse click and move listeners to the map.

It is functional, but this fails to distinguish pan events from real click events.

Does anyone have an approach I should use to avoid this problem?

I think it should be using a drawStart event and then the 'active' graphic to base measurements off. But I can not find where to listen for the drawStart or how to get a handle on the graphic being drawn.

This in in the 2.3 version of the viewer.
Any pointers much appreciated.

Steven
Tags (2)
0 Kudos
1 Reply
CarolineCochrane
Deactivated User
Hello Steven,

I am currently tasked with adding this 'on-the-fly' measurement functionality as you describe.
I appreciate that the new Advanced Draw and Measure widget does exaclty this, but as we are using a live viewer released at 2.3.1 with other customizations, i would prefer to just add in this fucntionality rather than upgrade completely to the Advanced widget.
I wondered if you had managed to get your widget doing as you wanted?
I would love to be able to simply add the mouseMove listener to the drawStart event and enable this to work with the current basic draw and measure tool if possible.

Really appreciate any help.

All the very best,


Caroline
0 Kudos