<?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: remove the last added graphic in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/1213161#M78729</link>
    <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run this same type of operation to remove the last added graphic to the map but my code isn't working. Would you mind pointing me in the right direction for correcting it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;$("#btnRemovepoint").click(function () {&lt;BR /&gt;// alert("there were " + obsPoints.length + " points.");&lt;BR /&gt;clearPointForm();&lt;BR /&gt;obsPoints.pop();&lt;BR /&gt;view.graphics.some(function (graphic) {&lt;BR /&gt;if (graphic.attributes["Name"] == "selected-" + lastObjectID) {&lt;BR /&gt;view.graphics.remove(graphic);&lt;BR /&gt;return true;&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;// todo remove last point graphic&lt;BR /&gt;// todo remove last point from input table&lt;BR /&gt;});&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2022 21:12:05 GMT</pubDate>
    <dc:creator>RaoulComaduran2</dc:creator>
    <dc:date>2022-09-15T21:12:05Z</dc:date>
    <item>
      <title>remove the last added graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749324#M69321</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Each time a user clicks on a list I add a new graphic on top of the clicked item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I want to remove the last graphic that&amp;nbsp;was created.&lt;/P&gt;&lt;P&gt;fyi, I can't do view.graphics.clear because before the user click I've created graphics that I need to keep.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;This creates the graphic&amp;nbsp;without problems.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;function onListClickHandler(event) {&amp;nbsp;&lt;BR /&gt; const target = event.target;&amp;nbsp;&lt;BR /&gt; const resultId = target.getAt tribute("data-result-id");&lt;BR /&gt; &lt;BR /&gt; // get the graphic corresponding to the clicked parcel&lt;BR /&gt; const result = resultId &amp;amp;&amp;amp; graphics &amp;amp;&amp;amp; graphics[parseInt(resultId,&lt;BR /&gt; 10)];&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var selectFillSymbol = {&lt;BR /&gt; type: "simple-fill", // autocasts as new SimpleFillSymbol()&lt;BR /&gt; color: [111, 0, 255, 0.3],&lt;BR /&gt; outline: { // autocasts as new SimpleLineSymbol()&lt;BR /&gt; color: [0,0,0],&lt;BR /&gt; width: 2&lt;BR /&gt; }&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var polygonGraphic = new Graphic({&lt;BR /&gt; geometry: result.geometry,&lt;BR /&gt; symbol: selectFillSymbol,&lt;BR /&gt; attributes: simpleFillAttributes&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;view.graphics.add(polygonGraphic);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;But none of these ideas below remove the graphic&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;capturing the reference of the last object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var lastResult = result&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;view.graphics.remove(lastResult);&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;view.graphics.remove(graphics[parseInt(lastResultId,&lt;/SPAN&gt;&lt;SPAN&gt;10)];&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;I tried adding an attribute to the new object&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;since result.attributes.OBJECTID works and gives back the objectid of the original clicked item.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var simpleFillAttributes = {&lt;BR /&gt;Name: "newgraphic-" + result.attributes.OBJECTID&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;var polygonGraphic = new Graphic({&lt;BR /&gt; geometry: result.geometry,&lt;BR /&gt; symbol: selectFillSymbol,&lt;BR /&gt; attributes: simpleFillAttributes&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;and then looping through all the graphics but this give me "cannot read property&amp;nbsp;Name of null"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;view.graphics.forEach(function (graphic) {&lt;BR /&gt; if (graphic.attributes["Name"] == "newgraphic-" + &lt;SPAN&gt;result.attributes.OBJECTID&lt;/SPAN&gt;) {&lt;BR /&gt; graphic.remove(graphic);&lt;BR /&gt;}&lt;BR /&gt; });&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;How can I remove the last graphic created?&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 00:06:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749324#M69321</guid>
      <dc:creator>GotQuestion</dc:creator>
      <dc:date>2018-10-10T00:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: remove the last added graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749325#M69322</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Your idea of looping through the graphics an&lt;/SPAN&gt;&lt;SPAN&gt;d&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;looking for an specific attribute is definitely the way to go but your code is wrong.&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;some&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Name"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"newgraphic-"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; result&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OBJECTID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;remove&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;View.graphics is a GraphicsLayer object not the graphics inside that layer thus you need view.graphics.graphics&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:50:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749325#M69322</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T07:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: remove the last added graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749326#M69323</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks for your help. I'm still having problems.&lt;/P&gt;&lt;P&gt;when I do view.graphics.graphics.some I get&amp;nbsp; &amp;nbsp;"&lt;STRONG&gt;cannot read property 'some' of undefined&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;so it never does the loop&lt;/P&gt;&lt;P&gt;when I do view.graphics.some it goes into the loop but then I get "&lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;cannot read property&amp;nbsp;Name of null"&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;fyi, I create the graphics fine doing view.graphics.add(polygonGraphic) not view.graphics.graphics.add&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 14:45:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749326#M69323</guid>
      <dc:creator>GotQuestion</dc:creator>
      <dc:date>2018-10-10T14:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: remove the last added graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749327#M69324</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I was confusing 3.x and 4.x properties.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In 4.x the view.graphics is a collection. in 3.x the map.graphics is a GraphicsLayer.&lt;/P&gt;&lt;P&gt;So the likely issue that the view is not initialized when you are trying to loop through it's graphics then.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;some&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; i&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Name &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"newgraphic-"&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; result&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OBJECTID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;remove&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried to console.log(&lt;SPAN&gt;view.graphics)?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 07:50:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749327#M69324</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T07:50:40Z</dc:date>
    </item>
    <item>
      <title>Re: remove the last added graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749328#M69325</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Got it working with view.graphics.some not view.graphics.graphics&lt;/P&gt;&lt;P&gt;The main original issue was &lt;STRONG style="background-color: #ffffff; border: 0px; font-weight: bold;"&gt;cannot read property&amp;nbsp;Name of null&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and this happened because I had created some graphic objects before the user did any clicking and those objects did not contain the custom attribute of Name but my new objects did have the Name attribute.&lt;/P&gt;&lt;P&gt;once I added the Name attribute to all the objects the code below works fine&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;view.graphics.some(function (graphic) {&lt;BR /&gt; if (graphic.attributes["Name"] == "selected-" + lastObjectID) {&lt;BR /&gt; view.graphics.remove(graphic);&lt;BR /&gt; return true;&lt;BR /&gt; }&lt;BR /&gt; });&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:09:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749328#M69325</guid>
      <dc:creator>GotQuestion</dc:creator>
      <dc:date>2018-10-10T15:09:48Z</dc:date>
    </item>
    <item>
      <title>Re: remove the last added graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749329#M69326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;got it. thanks! btw, what is the main difference between looping with some vs forEach?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:13:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749329#M69326</guid>
      <dc:creator>GotQuestion</dc:creator>
      <dc:date>2018-10-10T15:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: remove the last added graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749330#M69327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From the &lt;A href="http://dojotoolkit.org/reference-guide/1.10/dojo/_base/array.html#some"&gt;dojo documentation&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;CODE class=""&gt;&lt;SPAN class=""&gt;some()&lt;/SPAN&gt;&lt;/CODE&gt; semantically answers the question “does a test hold true for at least one item in the array?” Like &lt;A href="http://dojotoolkit.org/reference-guide/1.10/dojo/_base/array.html#foreach"&gt;forEach()&lt;/A&gt;, &lt;CODE class=""&gt;&lt;SPAN class=""&gt;some()&lt;/SPAN&gt;&lt;/CODE&gt; iterates over the items in an array. However, it short circuits and returns &lt;CODE class=""&gt;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;&lt;/CODE&gt; as soon as it encounters an item for which the provided callback returns a truthy value. If the callback doesn’t return &lt;CODE class=""&gt;&lt;SPAN class=""&gt;true&lt;/SPAN&gt;&lt;/CODE&gt; for any item, &lt;CODE class=""&gt;&lt;SPAN class=""&gt;some()&lt;/SPAN&gt;&lt;/CODE&gt; returns &lt;CODE class=""&gt;&lt;SPAN class=""&gt;false&lt;/SPAN&gt;&lt;/CODE&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Note&lt;/EM&gt;: Because of the short circuiting, &lt;CODE class=""&gt;&lt;SPAN class=""&gt;some()&lt;/SPAN&gt;&lt;/CODE&gt; can be more efficient than &lt;CODE class=""&gt;&lt;SPAN class=""&gt;forEach()&lt;/SPAN&gt;&lt;/CODE&gt; when the loop is used for comparison purposes.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 10 Oct 2018 15:17:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/749330#M69327</guid>
      <dc:creator>KenBuja</dc:creator>
      <dc:date>2018-10-10T15:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: remove the last added graphic</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/1213161#M78729</link>
      <description>&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run this same type of operation to remove the last added graphic to the map but my code isn't working. Would you mind pointing me in the right direction for correcting it?&amp;nbsp;&lt;/P&gt;&lt;P&gt;$("#btnRemovepoint").click(function () {&lt;BR /&gt;// alert("there were " + obsPoints.length + " points.");&lt;BR /&gt;clearPointForm();&lt;BR /&gt;obsPoints.pop();&lt;BR /&gt;view.graphics.some(function (graphic) {&lt;BR /&gt;if (graphic.attributes["Name"] == "selected-" + lastObjectID) {&lt;BR /&gt;view.graphics.remove(graphic);&lt;BR /&gt;return true;&lt;BR /&gt;}&lt;BR /&gt;});&lt;BR /&gt;// todo remove last point graphic&lt;BR /&gt;// todo remove last point from input table&lt;BR /&gt;});&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 21:12:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/remove-the-last-added-graphic/m-p/1213161#M78729</guid>
      <dc:creator>RaoulComaduran2</dc:creator>
      <dc:date>2022-09-15T21:12:05Z</dc:date>
    </item>
  </channel>
</rss>

