Select to view content in your preferred language

Drag and Drop Geometry

625
2
08-05-2011 11:27 AM
AndrewBlakey1
Emerging Contributor
Hi Everyone:

I want to create a widget that allows a user to drag and drop pre-defined geometry onto the map, which can then be the source of a geoprocessor or anything else you can do with a graphics layer. Is my proposed method the best way to do this, or is it possible to drag around graphics directly in the ESRI Flex construct? (ie. do it as an esri graphic and not a spark rectangle)

My proposed method:

After some research I'm thinking a way this may be possible is to let a user create a spark object (ie.a Rectangle) at the click of a button. The user can then move the rectangle wherever they please and by hitting a "GO" button, ActionScript will take the coordinates of the path coords of the rectangle, convert them to map coordinates and then construct a polygon from them.

Is there a better way of doing this?

Thanks!
Tags (2)
0 Kudos
2 Replies
grahamcooke
Regular Contributor
Andrew,

This is built into the out of the box draw widget I believe. The functionality is based on the EDITTOOL in the API which you can hook into in your code and then enable dragging and dropping as well as rotate etc...
0 Kudos
AndrewBlakey1
Emerging Contributor
Aha!

On first look I incorrectly concluded that using that method would not allow to permit move and rotate but not reshape (since I saw there was a boolean parameter to limit the adding of vertices but no boolean to limit other operations).

Thanks Graham.
0 Kudos