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?
-
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.htmlJames Milner– James Milner2016年01月06日 15:39:48 +00:00Commented 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– Bill B2016年01月07日 09:45:08 +00:00Commented Jan 7, 2016 at 9:45
-
Did you ever find a solution for this @BillB ?Maeglin77– Maeglin772017年08月04日 08:31:45 +00:00Commented Aug 4, 2017 at 8:31
-
What are you think about this answer?<br/> gis.stackexchange.com/questions/250847/…Sergey Kholmogorov– Sergey Kholmogorov2017年09月21日 10:46:53 +00:00Commented Sep 21, 2017 at 10:46
1 Answer 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.
-
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– Bill B2016年01月12日 05:43:58 +00:00Commented Jan 12, 2016 at 5:43