Lesson 7 Reflection

This lesson was a good introduction on how to use tools inherent in ArcGIS SDK for JavaScript to search, query and filter feature layers. The search function was straightforward and an easy concept to understand with the exception of what a search returns. I did not realize that the search only returned the first instance of what you were searching for. I discovered this when starting the homework and trying to understand why my search only found one point. That said, it seems like a great, and easy to implement, tool for searching for something unique, like an address.

This then leads to querying, which is better suited for searching for multiple features in a layer. The concept of creating queries and clauses was easy to understand as it seems similar to how one would code in Python. I did get slightly confused when it came to “promises.” It took me a few read throughs of the lesson, and then working with the homework, to fully understand “promises” and their association with. then/.when. The code explanation after the CodePen entries also helps but it would be more beneficial if there were actual line numbers in the code (as the explanation refers to them).

For the homework, I struggled at first with determining how to implement displaying features based on user input – this is mainly because I overlooked the requirement for Popup(). Since we had hardcoded queries and search only finds the first value, I could not figure out how to execute this without creating a GUI. I did start by adding an entry box and buttons, which worked, before realizing we were required to use a different method. Additionally, I desired to show all the data to start, and then allow the user to filter by a year. I was able to accomplish using text entry and a button (along with a "refresh" button) but I could not figure out how to generate unique class breaks for each year. Once I figured out we needed to use Popup(), I adjusted my code and it was straightforward. I was able to write code to create unique class breaks based on the range of data for each particular year. The downside is I used equal intervals instead of natural jenks. Given how the data was distributed, I think natural jenks would have been better for displaying but I could not think of an efficient way to create natural jenks for each year (19 total).