<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Undo edits of existing graphics using UndoManager in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535089#M49881</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yue,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the example you're referring to performs undo on a draw of a new graphic. I am looking to undo an edit to an existing graphic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jan 2016 14:27:25 GMT</pubDate>
    <dc:creator>VygintasCesnauskas</dc:creator>
    <dc:date>2016-01-22T14:27:25Z</dc:date>
    <item>
      <title>Undo edits of existing graphics using UndoManager</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535087#M49879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am looking for a way to undo edits such as move, scale and rotate of existing graphics on the map. So far I've tried to undo it in the same way as we currently undo 'draw' operations:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var editToolbar = new Edit(map);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; editToolbar.on("scale-stop, vertex-move-stop", function (evt) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var operation = new CustomOperation.Add({
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsLayer: selectedGraphicsLayer,
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; addedGraphic: evt.graphic
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; undoManager.add(operation);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However this undoes the action that happened directly previous to the 'edit', which in our case was 'draw' and removes the graphic from the map. Am I missing something or should I be using a different method altogether?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using following classes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edit - &lt;A href="https://developers.arcgis.com/javascript/jsapi/edit-amd.html#activate" title="https://developers.arcgis.com/javascript/jsapi/edit-amd.html#activate" rel="nofollow noopener noreferrer" target="_blank"&gt;Edit | API Reference | ArcGIS API for JavaScript&lt;/A&gt; &lt;/P&gt;&lt;P&gt;UndoManager - &lt;A href="https://developers.arcgis.com/javascript/jsapi/undomanager-amd.html#undomanager1" title="https://developers.arcgis.com/javascript/jsapi/undomanager-amd.html#undomanager1" rel="nofollow noopener noreferrer" target="_blank"&gt;UndoManager | API Reference | ArcGIS API for JavaScript&lt;/A&gt;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:14:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535087#M49879</guid>
      <dc:creator>VygintasCesnauskas</dc:creator>
      <dc:date>2021-12-11T23:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: Undo edits of existing graphics using UndoManager</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535088#M49880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Hi Vygintas, Have you tried to look up this sample? &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fdevelopers.arcgis.com%2Fjavascript%2Fjssamples%2Fgraphics_undoredo.html" rel="nofollow" target="_blank"&gt;https://developers.arcgis.com/javascript/jssamples/graphics_undoredo.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 22:08:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535088#M49880</guid>
      <dc:creator>YueWu1</dc:creator>
      <dc:date>2016-01-21T22:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: Undo edits of existing graphics using UndoManager</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535089#M49881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Yue,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately the example you're referring to performs undo on a draw of a new graphic. I am looking to undo an edit to an existing graphic.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2016 14:27:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535089#M49881</guid>
      <dc:creator>VygintasCesnauskas</dc:creator>
      <dc:date>2016-01-22T14:27:25Z</dc:date>
    </item>
    <item>
      <title>Re: Undo edits of existing graphics using UndoManager</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535090#M49882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a feeling this can't be done with the undo manager.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe what you can do is, save the current graphic, once it has been edited and you don't like the current graphic, delete it and add the saved graphic?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2016 14:44:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535090#M49882</guid>
      <dc:creator>TimWitt2</dc:creator>
      <dc:date>2016-01-22T14:44:00Z</dc:date>
    </item>
    <item>
      <title>Re: Undo edits of existing graphics using UndoManager</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535091#M49883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tim,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's a good idea, if undo manager for sure cannot be used in this case, I will go ahead with your suggestion. Perhaps Yue or someone else from ESRI staff could confirm this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2016 15:40:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535091#M49883</guid>
      <dc:creator>VygintasCesnauskas</dc:creator>
      <dc:date>2016-01-22T15:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Undo edits of existing graphics using UndoManager</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535092#M49884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just have points, and it works to undo a move.&amp;nbsp; There'd be no scale or rotate with those, though.&amp;nbsp; I was disappointed to see that undo/redo didn't include attribute changes.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Feb 2016 17:06:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/undo-edits-of-existing-graphics-using-undomanager/m-p/535092#M49884</guid>
      <dc:creator>TracySchloss</dc:creator>
      <dc:date>2016-02-02T17:06:03Z</dc:date>
    </item>
  </channel>
</rss>

