Wednesday, November 4, 2015

Lab 5: ArcGIS API for JavaScript 1

Introduction and Goals

Building off of the skills learned in lab 4, lab 5 focuses on ways one can build geographically based widgets, themes, and operational layers.  To do this, students will utilize ArcGIS JavaScript API as the performance interface.  This API will be embedded in an HTML document, so that it can be uploaded by end users on a variety of browsers (Firefox, Chrome, InternetExplorer).  As such, this lab will make use of HTML, CSS and JavaScript file formats.  The codes used in this lab were abstracted from Sylvia Richardson.

In terms of the objective of this lab, the goal is to become familiar with the ins and outs of ArcGIS JavaScript API to embed GIS services into any website.  Specific objectives include:
  • embedding GIS services to display and interact with a web map; 
  • customize a web GIS application created by someone else and apply it to a different study area by adding your own feature service to the application and also include additional map elements, and build a routing app that leverage network services from an external GIS server

In completing this lab, students should be familiar with writing simple JavaScript codes support multiple WebGIS applications while also becoming more comfortable with the JavaScript API in regards to creating geospatial applications.

Part 1

This portion of the lab has students create a site that displays a map that can be panned and zoomed on. To do this, students used HTML documents, JavaScript documents, and referenced ArcGIS API for use of a base map.   Students used the dojo library to import the the base map used for the website.  The importing of this library was via a JavaScript document that was subsequently refrenced in the HTML document for this website. Students also used the JS file to establish that center of the map, the standard zoom, and the the type of basemap they were extracting from the dojo library. Here is the website created using the basemap and tools from the dojo library and the ArcGIS online API.  Figure 1 and 2 below show the code used in creating this site.


figure 1: HTML doc. To see site, refer to link in paragraph above

 

figure 2: JavaScript linked to HTML in figure 1

























Part 2

Section 1


Part two requires that students build a Web GIS application, but this time the application be equipped with end-user interactive functionalities.  The specific app being made, will display the tree species and attributes of the trees in San Fransisco.  To do this, students created an HTML document, which links to a JavaScript doc also made by students, leverage an installed CSS file, and another JS file that was provided to the class. Here is the final WebApp for part 2 section 1

Part 3: Developing a simple routing application 

Similiar too part two of this lab, part 3 instructs that students create another web service.  The services this time will be one that finds routes between two or more points. The application will make use of a streets basemap that is provided bu Esri, and will form a route between two more locations which the end user will establish by simply clicking on the locations he or she would like to create a route between. like in part 2, this services was made by creating an HTML and an JavaScript file, while also referring to Esri for style guides and for the base-map.  Click here to see experience the  routing application, feel free to click around and route yourself anywhere in our great city of Eau Claire!!!


here is the actual HTML file text that was used to run the application:




Conclusion

parts of this lab were very difficult to manage through.  As i get more familiar with HTML and JS coding, I am becoming more aware of how important it is to diligently edit your work and check for errors as you go.  If you go through the entire coding process and wait till the very end to go through and look for the source of your error causing your script to nut run,  you will have a much more difficult time to find your error.  A helpful tip that me and my classmates have discovered is that using each other as resources can be very helpful.  So far, a second pair of eyes has been much better at finding the problem with a script as apposed to the same ones that have been scanning the same script for an hour already.  otherwise, i found this lab to be the most interactive and useful yet.  The application of this coding has a very broad spectrum of use beyond that which was done in this lab, and i look forward to continually building off of these skill.s  

No comments:

Post a Comment