Select to view content in your preferred language

Is there a preferred way to implement undo/redo functionality on an editable MapView?

232
2
08-01-2024 11:15 AM
JMMFIRE
Emerging Contributor

I'm researching ways in which I can implement undo/redo functionality on my editable MapViews. I see v3.xy had the UndoManager class that enabled this but I see no equivalent for 4.27.

Is this something that has to be handmade or am I missing some functionality with the Editor or within the MapView somewhere?

0 Kudos
2 Replies
JamesIng
Regular Contributor

The Sketch widget itself maintains a redo/undo stack that you can call on, but is limited to the sketch operation itself.
https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Sketch.html#event-undo

I created my own stack for operations outside of editing through the sketch widget.

James from www.landkind.com
0 Kudos
JMMFIRE
Emerging Contributor

Thanks for this! We use the Sketch widget in conjunction with the Editor to manage a diagramming tool for our client. The plan is for the undo/redo functionality to be functional across all editable layers. 

0 Kudos