<?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 graphicsLayer.remove*() not synchronous in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/graphicslayer-remove-not-synchronous/m-p/203216#M18854</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By definition, these functions&amp;nbsp;has no output values:&lt;/P&gt;&lt;P&gt;*&amp;nbsp;remove(graphic)&lt;/P&gt;&lt;P&gt;* removeAll()&lt;/P&gt;&lt;P&gt;* removeMany(graphics)&lt;/P&gt;&lt;P&gt;From my observation, they return before the graphics are actually removed. Geez, they should have used promise instead! If I want to do some geometric operations afterwards, how should I be notified when the graphics are actually removed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 03 Apr 2020 01:32:52 GMT</pubDate>
    <dc:creator>AlexPoon</dc:creator>
    <dc:date>2020-04-03T01:32:52Z</dc:date>
    <item>
      <title>graphicsLayer.remove*() not synchronous</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/graphicslayer-remove-not-synchronous/m-p/203216#M18854</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By definition, these functions&amp;nbsp;has no output values:&lt;/P&gt;&lt;P&gt;*&amp;nbsp;remove(graphic)&lt;/P&gt;&lt;P&gt;* removeAll()&lt;/P&gt;&lt;P&gt;* removeMany(graphics)&lt;/P&gt;&lt;P&gt;From my observation, they return before the graphics are actually removed. Geez, they should have used promise instead! If I want to do some geometric operations afterwards, how should I be notified when the graphics are actually removed?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Apr 2020 01:32:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/graphicslayer-remove-not-synchronous/m-p/203216#M18854</guid>
      <dc:creator>AlexPoon</dc:creator>
      <dc:date>2020-04-03T01:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: graphicsLayer.remove*() not synchronous</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/graphicslayer-remove-not-synchronous/m-p/203217#M18855</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should listen to&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-core-Collection.html#events-summary" rel="nofollow noopener noreferrer" target="_blank"&gt;events on your graphics collection&lt;/A&gt;. You can capture them as shown below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;layer&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;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"before-remove"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"after-remove"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&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;event&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;// process your logic here before and after the graphic is removed&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;

layer&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;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"after-remove"&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;event&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
  &lt;SPAN class="comment token"&gt;// process your logic here after the graphic is removed&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;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:05:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/graphicslayer-remove-not-synchronous/m-p/203217#M18855</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-12-11T10:05:37Z</dc:date>
    </item>
  </channel>
</rss>

