<?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: I can't remove the graphic added to the map in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1499501#M84954</link>
    <description>&lt;P&gt;I believe part of the problem may be that every time you execute&amp;nbsp;&lt;SPAN&gt;layer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;queryFeatures&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;),&amp;nbsp; the features you get in the results are new objects (even if they refer to the same underlying fearures).&amp;nbsp; So when you later try to remove them, you are essentially removing new feature objects that were never actually added to the view (I haven't tested this recently to confirm, but I'm pretty sure that's how it works).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I see two ways to deal with this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. Keep a list of the feature objects added to the view's graphics layer, and when you want to remove a graphic based on your query results, find the corresponding graphic that was added (e.g., using objectid as a lookup) and remove that from the views graphics layer instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. Instead of adding features as graphics, create a &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection/" target="_self"&gt;client-side feature layer&lt;/A&gt;&amp;nbsp;that matches the schema of the layer you are querying, and use appyEdits to add/remove features in it.&amp;nbsp; Then you can use objectids from your query results when you need to delete features from the layer.&lt;/P&gt;&lt;P&gt;I might be off the mark here, but hopefully one of these alternatives works for you.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Jun 2024 14:47:41 GMT</pubDate>
    <dc:creator>mleahy_cl</dc:creator>
    <dc:date>2024-06-29T14:47:41Z</dc:date>
    <item>
      <title>I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1498325#M84941</link>
      <description>&lt;P&gt;hello esri community.&lt;BR /&gt;I have a small problem can you help me?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;js code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;items&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;document&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;querySelectorAll&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;".item"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;// console.log(items)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;items&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;forEach&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;item&lt;/SPAN&gt; &lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;item&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;addEventListener&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"click"&lt;/SPAN&gt;&lt;SPAN&gt;, () &lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;item&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;classList&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;toggle&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"checked"&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;// if(item.className == "item checked"){&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;//alert("ekle")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;let&lt;/SPAN&gt; &lt;SPAN&gt;valitem&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;valitem&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;item&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;children&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;].&lt;/SPAN&gt;&lt;SPAN&gt;innerHTML&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;console&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;log&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;" ada parsel "&lt;/SPAN&gt;&lt;SPAN&gt; , &lt;/SPAN&gt;&lt;SPAN&gt;valitem&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;let&lt;/SPAN&gt; &lt;SPAN&gt;query&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;layer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;createQuery&lt;/SPAN&gt;&lt;SPAN&gt;();&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;where&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;`adaparsel = '&lt;/SPAN&gt;&lt;SPAN&gt;${&lt;/SPAN&gt;&lt;SPAN&gt;valitem&lt;/SPAN&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;SPAN&gt;'`&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;outFields&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;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;returnGeometry&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;true&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;layer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;queryFeatures&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;then&lt;/SPAN&gt;&lt;SPAN&gt;((&lt;/SPAN&gt;&lt;SPAN&gt;result&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;console&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;log&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;result&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;//let features = result.features;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;result&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;features&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;map&lt;/SPAN&gt;&lt;SPAN&gt;((&lt;/SPAN&gt;&lt;SPAN&gt;feature&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;SPAN&gt;=&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;let&lt;/SPAN&gt; &lt;SPAN&gt;staneName&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;attributes&lt;/SPAN&gt;&lt;SPAN&gt;[&lt;/SPAN&gt;&lt;SPAN&gt;"adaparsel"&lt;/SPAN&gt;&lt;SPAN&gt;];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;document&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getElementById&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"grafiksonuclar"&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;innerHTML&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;staneName&lt;/SPAN&gt; &lt;SPAN&gt;+&lt;/SPAN&gt; &lt;SPAN&gt;"Parsel No"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;resultgraphics&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;Graphic&lt;/SPAN&gt;&lt;SPAN&gt;({&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;geometry&lt;/SPAN&gt;&lt;SPAN&gt;:&lt;/SPAN&gt; &lt;SPAN&gt;feature&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;geometry&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; })&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;graphics&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;add&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;resultgraphics&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;goTo&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;resultgraphics&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;item&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;classList&lt;/SPAN&gt; &lt;SPAN&gt;==&lt;/SPAN&gt; &lt;SPAN&gt;"item"&lt;/SPAN&gt;&lt;SPAN&gt;){&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;document&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;getElementById&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"grafiksonuclar"&lt;/SPAN&gt;&lt;SPAN&gt;).&lt;/SPAN&gt;&lt;SPAN&gt;innerHTML&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;""&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;view&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;graphics&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;remove&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;resultgraphics&lt;/SPAN&gt;&lt;SPAN&gt;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&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;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}); &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 14:34:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1498325#M84941</guid>
      <dc:creator>emreaktas1</dc:creator>
      <dc:date>2024-06-27T14:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1498567#M84944</link>
      <description>&lt;P&gt;Try, resultGraphic.graphic.removeAll(); or resultGraphic.removeAll()&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2024 19:07:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1498567#M84944</guid>
      <dc:creator>MatthewDriscoll</dc:creator>
      <dc:date>2024-06-27T19:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1498875#M84949</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/327152"&gt;@MatthewDriscoll&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't get results.&lt;BR /&gt;appeared on screen did not remove black graphics&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="emreaktas1_0-1719554992986.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/108230i017E72ECAE502CAA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="emreaktas1_0-1719554992986.png" alt="emreaktas1_0-1719554992986.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't get results.&lt;BR /&gt;It did not remove the black graphics appearing on the screen.&lt;BR /&gt;I cannot add or remove graphics with the checkbox&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 06:11:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1498875#M84949</guid>
      <dc:creator>emreaktas1</dc:creator>
      <dc:date>2024-06-28T06:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1499501#M84954</link>
      <description>&lt;P&gt;I believe part of the problem may be that every time you execute&amp;nbsp;&lt;SPAN&gt;layer&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;queryFeatures&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;query&lt;/SPAN&gt;&lt;SPAN&gt;),&amp;nbsp; the features you get in the results are new objects (even if they refer to the same underlying fearures).&amp;nbsp; So when you later try to remove them, you are essentially removing new feature objects that were never actually added to the view (I haven't tested this recently to confirm, but I'm pretty sure that's how it works).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I see two ways to deal with this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. Keep a list of the feature objects added to the view's graphics layer, and when you want to remove a graphic based on your query results, find the corresponding graphic that was added (e.g., using objectid as a lookup) and remove that from the views graphics layer instead.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;2. Instead of adding features as graphics, create a &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection/" target="_self"&gt;client-side feature layer&lt;/A&gt;&amp;nbsp;that matches the schema of the layer you are querying, and use appyEdits to add/remove features in it.&amp;nbsp; Then you can use objectids from your query results when you need to delete features from the layer.&lt;/P&gt;&lt;P&gt;I might be off the mark here, but hopefully one of these alternatives works for you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2024 14:47:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1499501#M84954</guid>
      <dc:creator>mleahy_cl</dc:creator>
      <dc:date>2024-06-29T14:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1500204#M84960</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/621183"&gt;@mleahy_cl&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-featuretable-popup-interaction" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/sandbox/?sample=widgets-featuretable-popup-interaction&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I actually want to do is to show the data selected with selecet on the map, as in the example here.&lt;BR /&gt;By adding graphics this makes my application difficult to run.&lt;BR /&gt;How can I show the selected layer on the map in a simpler way?&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 08:13:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1500204#M84960</guid>
      <dc:creator>emreaktas1</dc:creator>
      <dc:date>2024-07-02T08:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1500407#M84964</link>
      <description>&lt;P&gt;Ok, it sounds to me like what you want is to highlight features.&amp;nbsp; You can highlight features on a LayerView (see the map view's `whenLayerView()` method) with a list of one or more object IDs.&amp;nbsp; That returns a handle object for that specific highlight.&amp;nbsp; When you want to remove that highlight, you use its `remove()` method.&lt;BR /&gt;&lt;BR /&gt;Here's a sample:&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/highlight-point-features/" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/sample-code/highlight-point-features/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;The highlight method specifically (on the FeatureLayerView class):&amp;nbsp;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-FeatureLayerView.html#highlight&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2024 16:25:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1500407#M84964</guid>
      <dc:creator>mleahy_cl</dc:creator>
      <dc:date>2024-07-02T16:25:08Z</dc:date>
    </item>
    <item>
      <title>Re: I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1501758#M84989</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/621183"&gt;@mleahy_cl&lt;/a&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, what I wanted was to highlight and I did this with the whenLayerView method.&lt;BR /&gt;What is the method to add a line between 2 selected data as in the screenshot.&lt;BR /&gt;I want to add a line to the selected data as in the screenshot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="emreaktas1_0-1720168507756.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/108878i7C01A9B308554D2F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="emreaktas1_0-1720168507756.png" alt="emreaktas1_0-1720168507756.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="emreaktas1_1-1720168578746.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/108879iE9D8A8979CE5EF33/image-size/medium?v=v2&amp;amp;px=400" role="button" title="emreaktas1_1-1720168578746.png" alt="emreaktas1_1-1720168578746.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jul 2024 08:36:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1501758#M84989</guid>
      <dc:creator>emreaktas1</dc:creator>
      <dc:date>2024-07-05T08:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1503918#M85007</link>
      <description>&lt;P data-unlink="true"&gt;That's a somewhat different question.&amp;nbsp; I think you'd be looking at creating your own geometry (e.g., a line from the centre of the highlighted item to some related location?), and either add a graphic using that geometry to the map's graphics layer, or to a &lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/layers-featurelayer-collection/" target="_self"&gt;client-side feature layer&lt;/A&gt;.&amp;nbsp; You could get the arrow effect with a &lt;A href="https://azuredevops.copperleaf.cloud/tfs/CopperLeafCollection/Five0/_git/Five0?version=GBusers%2Fmleahy%2FStory-80442-MapGridSelectionOfInvestments-main" target="_self"&gt;CIM symbol&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jul 2024 23:22:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1503918#M85007</guid>
      <dc:creator>mleahy_cl</dc:creator>
      <dc:date>2024-07-10T23:22:26Z</dc:date>
    </item>
    <item>
      <title>Re: I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1503985#M85008</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/621183"&gt;@mleahy_cl&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I make a line (eg Cım Symbol) from the center of the highlighted element to the center of the other highlighted element?&lt;BR /&gt;Is there any sample code on the subject?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jul 2024 06:11:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1503985#M85008</guid>
      <dc:creator>emreaktas1</dc:creator>
      <dc:date>2024-07-11T06:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: I can't remove the graphic added to the map</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1504789#M85022</link>
      <description>&lt;P&gt;I don't know of any examples offhand.&amp;nbsp; You can query the geometry for the features you're working with, and use those to derive start and end points (e.g., you can get a centroid from polygons).&amp;nbsp; Use those two points to construct a polyline geometry, then use that geometry to create your graphic to display on the map.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 14:04:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/i-can-t-remove-the-graphic-added-to-the-map/m-p/1504789#M85022</guid>
      <dc:creator>mleahy_cl</dc:creator>
      <dc:date>2024-07-12T14:04:56Z</dc:date>
    </item>
  </channel>
</rss>

