3

In ArcGIS JavaScript API, I want to click a GraphicsLayer object (Graphic) on the map and perform a dragging MOVE operation for it as well as some of its neighboring graphics. I am looking for the visual effect of several graphic objects moving together. The EDIT toolbar MOVE operation accepts a single graphic, not multiple, as far as I see.

editToolbar.activate(Edit.MOVE, evt.graphic);

Can I aggregate into a single Graphic for use with EDIT toolbar?

Activate a toolbar for each Graphic?

4
  • As far as I can tell the method only takes singular graphics. Using multipl tool bars is an option but seems a little unwieldly and memory intensive. Perhaps you can construct something custom using developers.arcgis.com/javascript/jsapi/cut-amd.html Commented Jan 6, 2016 at 15:39
  • @James - thanks, I was not aware of Cut and I will have to add it to my repertoire ... Here, my key UX goal is to provide a visual 'drag' of a few related graphics, having click-selected one of them. I could not see how Cut plays into this.
    – Bill B
    Commented Jan 7, 2016 at 9:45
  • Did you ever find a solution for this @BillB ?
    – Maeglin77
    Commented Aug 4, 2017 at 8:31
  • What are you think about this answer?<br/> gis.stackexchange.com/questions/250847/… Commented Sep 21, 2017 at 10:46

1 Answer 1

1

The way I would go about this is to, when you go into EDIT mode, convert your multiple point (I'm assuming) graphics that you want to drag at the same time into a single Graphic, using the Multipoint geometry, then enable the Draw toolbar on that single Graphic. When you're done moving (the user indicates they want to leave Edit mode), you can take the geometries in your Multipoint and convert them back out to individual point Graphics.

1
  • Gavin, my graphics are polygons and points - so cannot use Multipoint. I guess the is no way aggregate these into a single graphic for Edit toolbar. :(
    – Bill B
    Commented Jan 12, 2016 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.