Select to view content in your preferred language

Move Toolbar for multiple polygons at the same time

1445
3
08-03-2017 06:29 AM
DylanBulteel
Emerging Contributor

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)
0 Kudos
3 Replies
AdrianWelsh
MVP Honored 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 

0 Kudos
DylanBulteel
Emerging Contributor

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

Vara_PrasadM_S
Frequent Contributor

Hi,

Could you please let me know if you find any solution or any approach to move multiple polygons together for edit using JS API 3.X.

Thanks in advance!

With Regards,

Vara Prasad

0 Kudos