<?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 ApplyEdits Issues - Map Not Redrawing in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-issues-map-not-redrawing/m-p/1084867#M74094</link>
    <description>&lt;P&gt;Hey everyone -- has anyone seen performance issues with ApplyEdits on 4.20?&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're getting an issue with our code in which the map is not redrawing after an apply edits function is called. We are also getting an error with an esri core worker, which may or may not be related. I can see in my console that deletedFeatures is in fact being applied, but then the map doesn't update. Interestingly, when I zoom in our out, I lose my labels on the feature reduction cluster unless I come back to the initial zoom level. Not sure if there was a breaking change I missed or if this is a known or unknown issue.&lt;/P&gt;&lt;P&gt;Here are some snippets of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;public async getCurrentFeatures(): Promise&amp;lt;any&amp;gt; {
    const query: __esri.Query = this.currentLayer.createQuery();
    try {
      const { features } = await this.currentLayer.queryFeatures(query);
      return features;
    } catch (e) {
      this.reportError(e);
    }
  }


public async rendersAssetsMatchingSearchToMap(sites: SiteSummary[]): Promise&amp;lt;void&amp;gt; {

    if (this.currentLayer) {
      const addFeatures: __esri.Graphic[] = [];
      const regionsInSites = {};
      sites.forEach(siteSummary =&amp;gt; {
        if (!isNaN(siteSummary.latitude) &amp;amp;&amp;amp; !isNaN(siteSummary.longitude)) {
          addFeatures.push(this.makeASiteGraphic(siteSummary));
        }
      });

      const deleteFeatures = await this.getCurrentFeatures();
      const edits: __esri.FeatureLayerApplyEditsEdits = {};
      if (addFeatures?.length) {
        edits.addFeatures = addFeatures;
      }
      if (deleteFeatures?.length) {
        edits.deleteFeatures = deleteFeatures;
      }

      this.currentLayer
        .applyEdits(edits)
        .catch(e =&amp;gt; {
          console.log(e);
        });
      }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I run this, I can see in the console that it is being applied. This is on a "clear" call, so there wouldn't be any addFeatures.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rogenjh_0-1627906949719.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19883iF8954239903BB9C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rogenjh_0-1627906949719.png" alt="rogenjh_0-1627906949719.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Map doesn't update:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rogenjh_1-1627907005837.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19884i33806ACDC1CC351E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rogenjh_1-1627907005837.png" alt="rogenjh_1-1627907005837.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does lose labels when I zoom out:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rogenjh_2-1627907030975.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19885iBF275DB3353A105D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rogenjh_2-1627907030975.png" alt="rogenjh_2-1627907030975.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Labels return when I zoom back in...(no additional searches applied)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rogenjh_3-1627907050669.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19886i35D3CCBA3EBA334E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rogenjh_3-1627907050669.png" alt="rogenjh_3-1627907050669.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Anyone have thoughts or ideas here? Again, this just recently started and it was all working fine before the updates.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Aug 2021 12:25:15 GMT</pubDate>
    <dc:creator>rogenjh</dc:creator>
    <dc:date>2021-08-02T12:25:15Z</dc:date>
    <item>
      <title>ApplyEdits Issues - Map Not Redrawing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-issues-map-not-redrawing/m-p/1084867#M74094</link>
      <description>&lt;P&gt;Hey everyone -- has anyone seen performance issues with ApplyEdits on 4.20?&amp;nbsp;&lt;/P&gt;&lt;P&gt;We're getting an issue with our code in which the map is not redrawing after an apply edits function is called. We are also getting an error with an esri core worker, which may or may not be related. I can see in my console that deletedFeatures is in fact being applied, but then the map doesn't update. Interestingly, when I zoom in our out, I lose my labels on the feature reduction cluster unless I come back to the initial zoom level. Not sure if there was a breaking change I missed or if this is a known or unknown issue.&lt;/P&gt;&lt;P&gt;Here are some snippets of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;public async getCurrentFeatures(): Promise&amp;lt;any&amp;gt; {
    const query: __esri.Query = this.currentLayer.createQuery();
    try {
      const { features } = await this.currentLayer.queryFeatures(query);
      return features;
    } catch (e) {
      this.reportError(e);
    }
  }


public async rendersAssetsMatchingSearchToMap(sites: SiteSummary[]): Promise&amp;lt;void&amp;gt; {

    if (this.currentLayer) {
      const addFeatures: __esri.Graphic[] = [];
      const regionsInSites = {};
      sites.forEach(siteSummary =&amp;gt; {
        if (!isNaN(siteSummary.latitude) &amp;amp;&amp;amp; !isNaN(siteSummary.longitude)) {
          addFeatures.push(this.makeASiteGraphic(siteSummary));
        }
      });

      const deleteFeatures = await this.getCurrentFeatures();
      const edits: __esri.FeatureLayerApplyEditsEdits = {};
      if (addFeatures?.length) {
        edits.addFeatures = addFeatures;
      }
      if (deleteFeatures?.length) {
        edits.deleteFeatures = deleteFeatures;
      }

      this.currentLayer
        .applyEdits(edits)
        .catch(e =&amp;gt; {
          console.log(e);
        });
      }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After I run this, I can see in the console that it is being applied. This is on a "clear" call, so there wouldn't be any addFeatures.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rogenjh_0-1627906949719.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19883iF8954239903BB9C1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rogenjh_0-1627906949719.png" alt="rogenjh_0-1627906949719.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Map doesn't update:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rogenjh_1-1627907005837.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19884i33806ACDC1CC351E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rogenjh_1-1627907005837.png" alt="rogenjh_1-1627907005837.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It does lose labels when I zoom out:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rogenjh_2-1627907030975.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19885iBF275DB3353A105D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rogenjh_2-1627907030975.png" alt="rogenjh_2-1627907030975.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Labels return when I zoom back in...(no additional searches applied)&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rogenjh_3-1627907050669.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19886i35D3CCBA3EBA334E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rogenjh_3-1627907050669.png" alt="rogenjh_3-1627907050669.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Anyone have thoughts or ideas here? Again, this just recently started and it was all working fine before the updates.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 12:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-issues-map-not-redrawing/m-p/1084867#M74094</guid>
      <dc:creator>rogenjh</dc:creator>
      <dc:date>2021-08-02T12:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyEdits Issues - Map Not Redrawing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-issues-map-not-redrawing/m-p/1084910#M74098</link>
      <description>&lt;P&gt;And if this helps at all ... this is the error I'm seeing.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="rogenjh_0-1627913726542.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/19893iD578B781BFB53867/image-size/medium?v=v2&amp;amp;px=400" role="button" title="rogenjh_0-1627913726542.png" alt="rogenjh_0-1627913726542.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Aug 2021 14:15:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-issues-map-not-redrawing/m-p/1084910#M74098</guid>
      <dc:creator>rogenjh</dc:creator>
      <dc:date>2021-08-02T14:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyEdits Issues - Map Not Redrawing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-issues-map-not-redrawing/m-p/1085937#M74151</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible for you to share your service with me? It would help to narrow down the issue. If not then, can you please tell me if it is enterprise of hosted feature service? If enterprise then what version of the server are you using?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;</description>
      <pubDate>Wed, 04 Aug 2021 20:39:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-issues-map-not-redrawing/m-p/1085937#M74151</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-08-04T20:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: ApplyEdits Issues - Map Not Redrawing</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-issues-map-not-redrawing/m-p/1086626#M74184</link>
      <description>&lt;P&gt;Oh man ... I'm getting mixed up what you mean by service here, my apologies. I'm currently on ArcMap FeatureLayer if that helps.&lt;/P&gt;&lt;P&gt;For what this is worth ... I reverted to 4.19.0 and the code is now working.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Aug 2021 15:30:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/applyedits-issues-map-not-redrawing/m-p/1086626#M74184</guid>
      <dc:creator>rogenjh</dc:creator>
      <dc:date>2021-08-06T15:30:39Z</dc:date>
    </item>
  </channel>
</rss>

