Move Toolbar for multiple polygons at the same time

564
2
08-03-2017 06:29 AM
New Contributor II

Is there a way of moving two or more polygons simultaneously as I cannot seem to find a method that allows the movement of multiple selected graphics at the same time. The movement has to be a click and drag process where the features are seen to be dragged at the same time.

With the following code I manage to activate multiple toolbars for multiple graphics at the same time, however they still move separately rather than being moves as a whole when one of them is clicked and dragged.

//Loop to get all the layers on the mapfor (var gCount = 0; gCount < app.map.graphicsLayerIds.length; gCount++) {    //This will obtain the layer that the selected graphic is on     var tempMoveLayer = app.map.getLayer(app.map.graphicsLayerIds[gCount]);     //Looping through all the graphics in the selected layer    for (var graphicNum = 0; graphicNum < tempMoveLayer.graphics.length; graphicNum++) {         //Comparing the selected graphic to the layer graphic currently in the loop        if (tempMoveLayer.graphics[graphicNum].attributes.OBJECTID == results.features[j].attributes.OBJECTID) {         //Activating the toolbar for the graphic. This is activated for every graphic in the loop        moveToolbar.activate(esri.toolbars.Edit.MOVE | esri.toolbars.Edit.SCALE | esri.toolbars.Edit.ROTATE, tempMoveLayer.graphics[graphicNum]);                                                             }                                                        }                                                    }
Tags (2)
Reply
0 Kudos
2 Replies
MVP Notable Contributor

Dylan,

I am not sure if this is helpful or not but when I have Map Topology selected when editing in ArcGIS Pro‌, my polygons all move at the same time (when they're geographically similar):

Introduction to editing topology—ArcGIS Pro | ArcGIS Desktop 

Reply
0 Kudos
New Contributor II

Had never heard of Map Topology seems interesting. I checked up on it however there doesn't seem to be a way to apply this to the argic javascript api which kind of sucks. But thanks for the information