[GIS] Move/Drag multiple graphics in ArcGIS JavaScript API

arcgis-javascript-api

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?

Best Answer

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.