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.
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.
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, & async/await and I have repeatedly failed.
Here is the link to my Fiddle.
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.
Steve