AnsweredAssumed Answered

how to arcgis javascript vertex undoManager

Question asked by guriguri1576 on Jun 1, 2016
Latest reply on Jun 1, 2016 by thejus.kambi

I try to undo / redo the edit vertex using undomanager.

 

 

Graphic objects are tested. But I do not know what to do Edit vertex  undo / redo.

 

 

Is it possible the vertex undo / redo?

 

 

I looked to find many examples have not found the answer.

 

 

i`m korean beginner programmer. help me~ T.T

 

 

  

       function initEditing(evt) {

          console.log("initEditing", evt);

          var currentLayer = null;

          var layers = arrayUtils.map(evt.layers, function(result) {

            return result.layer;

            console.log("result ==== "+result);

          });

          console.log("layers", layers);

 

 

           editToolbar = new Edit(map);

          editToolbar.on("deactivate", function(evt) {

         console.log("deactivate !!!! ");

            currentLayer.applyEdits(null, [evt.graphic], null);

          });

 

 

          arrayUtils.forEach(layers, function(layer) {

            var editingEnabled = false;

            layer.on("dbl-click", function(evt) {

              event.stop(evt);

              if (editingEnabled === false) {

                editingEnabled = true;

                editToolbar.activate(Edit.EDIT_VERTICES , evt.graphic);

                pre_evt = evt.graphic;

                editToolbar.on("vertex-move-stop", function(evt){

                console.log("vertex-move-stop~");

                g_evt = evt;

                console.log("evt.transform ===== " +evt.transform);

              var operation = new esri.dijit.editing.Update({

              featureLayer : landusePointLayer,

              preUpdatedGraphics:pre_evt,

                         postUpdatedGraphics: evt.graphic

              })

                  var operation = new CustomOperation.Add({

                                  graphicsLayer: pre_evt._graphicsLayer,

                                    addedGraphic: evt.graphic

                                  });

                                undoManager.add(operation);

              console.log("operation ======== ",operation);

                });

               

                console.log("dbl-click  & eidt  true");

              } else {

                currentLayer = this;

                editToolbar.deactivate();

                editingEnabled = false;

                console.log("dbl-click  & eidt false ");

              }

            });

Outcomes