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 – James Milner Jan 6 '16 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 Jan 7 '16 at 9:45
  • Did you ever find a solution for this @BillB ? – Maeglin77 Aug 4 '17 at 8:31
  • What are you think about this answer?<br/> gis.stackexchange.com/questions/250847/… – Sergey Kholmogorov Sep 21 '17 at 10:46
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 Jan 12 '16 at 5:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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