<?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: Caught in an Async issue in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/caught-in-an-async-issue/m-p/430243#M39557</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;I have not run the your test app but have looked through the code quickly. When you are adding, removing or updating graphics in FeatureCollection you need to&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits"&gt; FeatureLayer.applyEdits&lt;/A&gt; method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a simple&lt;A href="https://codepen.io/U_B_U/pen/wvwJNOb"&gt; test app&lt;/A&gt; to show the workflow to add client side graphics to a featurecollection at runtime. To use the app, click the button right under the zoom in/out buttons.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some useful links:&lt;/P&gt;&lt;P&gt;See Add an array of client-side features section under&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating-a-featurelayer"&gt; creating a featurelayer&lt;/A&gt; section.&lt;/P&gt;&lt;H3 style="color: #4c4c4c; background-color: #ffffff; font-size: 1.69949rem; margin: 0px 0px 0.75rem;"&gt;&lt;/H3&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 26 Aug 2019 17:21:59 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2019-08-26T17:21:59Z</dc:date>
    <item>
      <title>Caught in an Async issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/caught-in-an-async-issue/m-p/430242#M39556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been trying for 2 days to figure this out and I just can't. I believe that I'm experiencing an issue with inputs are available when needed because they're generated async and they're not ready when they're called upon.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My app asks the user to specify a local folder location (using the HTML 5 File functionality) and then it reads in the files of the specified folder to filter out the image files. Using the list of image files, I want it to then map the photo locations by creating a Feature Layer using a feature collection. This is accomplished by using an EXIF reading JS library to extract out the lat/long of any geotagged photos while looping through the list of image files. Well, that's the theory.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In practice, the array generated of my feature collection is never populated when the code needs it during the featureLayer creation. I think the process of looping through the files is still happening and so the feature collection isn't populated. I've tried to implement promises,thens,&amp;nbsp; &amp;amp; async/await and I have repeatedly failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the &lt;A href="https://jsfiddle.net/scole/u1fyvng8/"&gt;link to my Fiddle&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to "run" the app, you just need a local folder with at least one geotagged photo in it. Run the app, click the Browse button to select the folder and that's it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 Aug 2019 22:46:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/caught-in-an-async-issue/m-p/430242#M39556</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2019-08-23T22:46:34Z</dc:date>
    </item>
    <item>
      <title>Re: Caught in an Async issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/caught-in-an-async-issue/m-p/430243#M39557</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;I have not run the your test app but have looked through the code quickly. When you are adding, removing or updating graphics in FeatureCollection you need to&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#applyEdits"&gt; FeatureLayer.applyEdits&lt;/A&gt; method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have created a simple&lt;A href="https://codepen.io/U_B_U/pen/wvwJNOb"&gt; test app&lt;/A&gt; to show the workflow to add client side graphics to a featurecollection at runtime. To use the app, click the button right under the zoom in/out buttons.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some useful links:&lt;/P&gt;&lt;P&gt;See Add an array of client-side features section under&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#creating-a-featurelayer"&gt; creating a featurelayer&lt;/A&gt; section.&lt;/P&gt;&lt;H3 style="color: #4c4c4c; background-color: #ffffff; font-size: 1.69949rem; margin: 0px 0px 0.75rem;"&gt;&lt;/H3&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Aug 2019 17:21:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/caught-in-an-async-issue/m-p/430243#M39557</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2019-08-26T17:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: Caught in an Async issue</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/caught-in-an-async-issue/m-p/430244#M39558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help. It has taken a few days of digesting &amp;amp; tinkering but I feel I'm now back on track. I was already doing some of what you had suggested in your response but tweaking my app to more closely follow your sample was the right call. Honestly, I'm still having the async issue even with your code as a roadmap but, prior to me seeing your post, I added a setTimeout() block in my code and that was enough to prevent the operation from overrunning itself.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I should also note that your response in &lt;A _jive_internal="true" href="https://community.esri.com/thread/223433-v49-feature-layer-applyedits-bug"&gt;this thread about an applyEdits issue&lt;/A&gt; was also helpful. Thanks again!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steve&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Aug 2019 22:34:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/caught-in-an-async-issue/m-p/430244#M39558</guid>
      <dc:creator>SteveCole</dc:creator>
      <dc:date>2019-08-27T22:34:55Z</dc:date>
    </item>
  </channel>
</rss>

