Thursday, October 26, 2017

Web GIS Lab 4: Basic HTML, CSS, and JavaScript

Goal and Background

In this lab, students are introduced to necessary languages needed to develop Web GIS applications with the ArcGIS API for JavaScript. Basic methods and syntax of Hypertext Markup Language (HTML), cascading style sheets (CSS), and JavaScript, which are all commonly used in webpage development, will be introduced and used in this lab. HTML is the standard markup language for creating web pages and applications. CSS is a stylesheet language that describes the appearance of an HTML document. JavaScript is the scripting language for web pages. Using these three languages simultaneously, students will development a functional website.

This lab is divided up into four parts which include:
  1. Developing a web page using HTML tags
  2. Styling your web page using CSS
  3. Introduction to JavaScript
  4. Building a customized webpage

Methods

Part 1: Developing a web page using HTML tags

> Open a new Notepad++ program sheet
> Define the DOCTYPE, <head>, and <title> tags; the title should say "My Test Page"
> Next, set the <body> tag which should contain the following:

  • Three levels of header that describe the website
  • Your name, course, and semester
  • Your UWEC department information
  • Your hobbies
  • Last date at which the web page was updated
  • Credits for part of CSS and JavaScript codes that you will use in parts 2 and 3
> Insert a <body> tag underneath the closing </head> tag
> Insert an opening <div> tag with an id="header"; enter the following child levels of header (<h1> through <h3>) where <h2> should have your first and last name, course number, and semester; close the </div> tag after <h3> (Figure 1)

Figure 1: First block of HTML code
> Start a new paragraph by entering a <p> tag and type the following in italics, "This is the result of my first HTML code"; create another <p> tag and type the following in bold, "These are my hobbies"
> Next, we will create an unordered list of hobbies; enter an unordered list opening tag <ul> right after the comment; list six of your own hobbies within the child list <li> item tag; close the </ul> tag after your list of hobbies; insert a closing </div> tag at the end of the list (Figure 2)

Figure 2: Second block of HTML code
> Save the HTML page by clicking File > Save As and select 'Hyper Text Markup Language file' then navigate to the proper folder and name it 'index_YourInitials'
> After saving, create six non-breaking space paragraphs <p>&nbsp;</p> where a picture will be inserted in part 2
> Enter a <div> tag with an 'id' which will display the last date the website was updated; enter a final <div> tag with a footer 'id' which will display the credits and also a source reference link 'href' to Creative Commons website
> Finally, close the </body> tag and the </html> document (Figure 3)

Figure 3: Third block of HTML code
> Save your document and launch it in a browser; it should look like the one below (Figure 4)

Figure 4: Result of part 1 HTML code writing

Part 2: Styling your web page using CSS

Section 1: Styling the various sections of a webpage

> We will now improve the display of the web page by styling it with CSS
> Open up a blank Notepad++ document; enter a comment on line 1 that says "Overall Design"
> Enter a body{ selector and give it 'background-color' and 'font-family' properties; close the body element with a '}' (Figure 5)

Figure 5: First block of CSS code
> Hit 'Enter' to create a space and insert a #wrapper{ selector and its width, margin, and background-color properties; close the wrapper selector with a '}' (Figure 6)

Figure 6: Second block of CSS code
> Type in a #header{ selector and its properties as shown below (Figure 7)

Figure 7: Third block of CSS code
> Hit 'Enter' to create a space and insert a #main{ selector with 'background-color' as '#fff' and a 'padding' of '1em'; insert a #sidebar{ and its properties below the #main id selector (Figure 8)

Figure 8: Fourth block of CSS code
> Insert a #footer{ selector and its properties below the #sidebar selector; next, insert a div#footer a{ selector and property for the link in the footer of your web page (Figure 9)

Figure 9: Fifth block of CSS code
> Save the file as a 'Cascade Style Sheets File' and name it 'styles_YourInitials' in the proper folder; close the CSS file you just saved

> For the stylesheet to work in the HTML page, we have to link the CSS file to the HTML document in the <head> tag; open the HTML file you created in part 1 and insert a <link> tag under the <title> tag and reference the 'styles_YourInitials' CSS file (Figure 10)

Figure 10: Linking the CSS file to the HTML file
> Continuing to work in the HTML document, format the second <h3> header tag so that it is on the same line as the first <h3> header tag (Figure 11)

Figure 11: Formatting the <h3> tag
> Insert a <div id> for the wrapper directly below the start of the <body> tag; insert a <div id> for the main styling of the body of the HTML document below the header <hn> divs (Figure 12)

Figure 12: <div id> for the wrapper and main in the HTML document

Section 2: Adding forms to an HTML document

> In this section, students create a simple form along with a submit button to allow end-users of the webpage to be able to leave comments. A <form> tag is inserted with a simpleForm id in the HTML document. The form is labeled "Input" and a simpleSubmit id is inserted afterwards. The form is then closed with a </form> tag (Figure 13).

Figure 13: HTML code for the simple form and submit button
> The webpage is now further improved by adding a picture of the Web GIS app that was developed in lab 3. A link to that app will be included as well so that end-users can examine it.

Part 3: Introduction to JavaScript

Results

Part 1: Developing Web Page Using HTML Tags

The resulting web page from part 1 can be viewed below (Figure 14). This web page is at its very basic form and has very little functionality and no styling.

Figure 14: Result from part 1 
Part 2: Styling Web Page Using CSS

The results of incorporating CSS into the HTML page can be viewed below (Figure 15). The web page is still very basic with little functionality, but its appearance is much more attractive.

Figure 15: Result from part 2
Part 3: Introduction to JavaScript

The results of incorporating JavaScript into the HTML page can be viewed below (Figure 16). While it is still a simple HTML, it now has increased functionality and the end result looks much more attractive than it did after part 1.

Figure 16: Result from part 3
Sources

UWEC Website (logo):
University of Wisconsin-Eau Claire. (n.d.). Retrieved 2015, from http://www.uwec.edu/

Sylvia Richardson of Girl Develop It via Github (2015):
Richardson, S. (n.d.). Girl Develop It. Retrieved 2015, from https://github.com/girldevelopit

Monday, October 16, 2017

Web GIS Lab 3: Web AppBuilder for ArcGIS

Goal and Background

This lab exercise introduces students to building Web GIS applications using the Web AppBuilder for ArcGIS. Students will create an application, add services, add and configure custom widgets, and finally deploy the finished application to be utilized by end-users. Although there is no coding performed in this lab, students are to think about the coding that is written in the creation of the Web GIS applications being created.

The two parts featured in this lab include:
  1. Building Web GIS apps through Web AppBuilder Integrated Edition
  2. Customizing Web AppBuilder for ArcGIS (Developer Edition)

Methods 

Part 1: Building Web GIS apps through Web AppBuilder Integrated Edition

Section 1: Design Web AppBuilder and initial widgets



Section 2: Configure additional widgets

Part 2: Customizing Web AppBuilder for ArcGIS (Developer Edition)

Section 1: Start Web AppBuilder for ArcGIS

Section 2: Customizing the Web AppBuilder Developer Edition

Results 

Sources

Fu, Pinde (2015)

HERE

USGS National Atlas

NOAA National Climatic Data Center

Thursday, October 5, 2017

Web GIS Lab 2: Geospatial Web Services

Goal and Background

This lab introduces students to creating geospatial web services through ArcGIS Online and ArcGIS Server in which they will author and publish feature classes, raster, and an Excel CSV file via ArcMap and ArcGIS Pro.

In this lab students will engage in the following tasks:
  1. Publishing feature hosted services through ArcGIS Online
  2. Publishing a tiled map service using ArcGIS Server
  3. Author a map document, create a feature service, and add this to a web map
*Data for this lab can be found in the Lab2_data.zip file on the D2L website; contains data for all sections of the lab*

Methods

Part 1: Publishing feature hosted services through ArcGIS Online

Section 1: Publishing a feature hosted service using a shapefile

> Open ArcMap and load the data for Part 1 Section 1 which contains Wisconsin features including cities, interstates, highways, and counties; close ArcMap

> Return to the Part 1 Section 1 folder, select all the features, and right click and select 'Send to' > 'Compressed (Zipped) folder' (Figure 1); this will create a zip file of the selected data in the folder

Figure 1: Creating a zip file
> Change the name of the folder to 'Wisconsin_transportation.zip' and be sure to not delete the .zip file extension while renaming it; now you will publish a shapefile in ArcGIS.com

> Sign in to ArcGIS Online for organizations; click on 'Content' > 'My Content' > 'Add Item' > 'From My Computer' (Figure 2); click 'Choose File' button and select the 'Wisconsin_transportation.zip' file created earlier
Figure 2: Add Item from computer in ArcGIS Online
> Enter the title 'Wisconsin transportation data service_YourLastName'; type in at least four appropriate tags; click 'Add Item' at the bottom of the window which will then publish the file as a service; once the file is published, a thumbnail will appear that should look like the one below (Figure 3)
Figure 3: Wisconsin transportation data
service feature layer thumbnail
> From here, you can view the service in the map viewer, making desired changes and edits, and share items as well.

Section 2: Publishing a feature hosted service using a CSV file

Instead of using a shapefile, we will now publish an Excel CSV (comma separated value) file. The file is titled 'WI_fire_occ_2004' and is located in the Lab 2 Data folder. The Excel sheet must be saved as a CSV file before it can be published.

> Open the 'WI_fire_occ_2004' file; save it as a CSV file and name it 'WI_fire_occ_2004_YourLastName'

> In ArcGIS.com, follow the similar procedure as in the previous section to publish the file; use the recently saved fire occurence CSV file as the input file; name it something along the lines of 'Wisconsin 2004 fire occurrence'; add at least two appropriate tags

> Under 'Locate features by:' select 'Coordinates'; under the 'Location Fields' heading for the 'POINT_Y' Field Name select 'Latitude' and for the 'POINT_X' Field Name select 'Longitude' (Figure 4)
Figure 4: Setting up the coordinates values from
 the CSV file in the 'Add an item' window
> Click on 'Add Item' at the bottom of the window to publish the service; verify the service has been published by opening the service in the map viewer

> When clicking on any fire occurrence, we only want the FIREDATE field to show; click on 'Content' > 'More Option' > 'Configure Pop-up' (Figure 5) to configure the pop-ups

Figure 5: Configure pop-ups in map viewer
> Under 'Pop-up Contents' change display from 'A list of field attributes' to 'A description from one field' and select 'FIREDATE' as the field; click 'OK' at the bottom of the window to finish configuring pop-ups

Section 3: Publishing a feature hosted service using an ArcMap document



Part 2: Publishing a tiled map service using ArcGIS Server

Section 1: Publishing a service to ArcGIS Server using ArcMap


Section 2: Consuming the map service in a web application


Section 3: Publishing a service to a Portal using ArcGIS Pro


Part 3: Author a map document, create a feature service, and add these to a web map

Section 1: Author a feature access and time-enabled service data

Section 2: Consume a feature access time-enabled service




Results

Result #1: Feature hosted service using a shapefile

URL: http://uwec.maps.arcgis.com/home/item.html?id=12cb4fa746504ba588d833e8f9d3c469

The end product 'Wisconsin transportation date service_Jeffers' feature hosted using a shapefile can be seen below (Figure ):
Figure : Wisconsin transportation data feature hosted
service that was created using a shapefile
This is what the service looks like when it is opened in map viewer on ArcGIS Online. From here, users can perform a number of task such as editing and customizing the map layers, adding other layers, change the basemap, run analyses, etc., and once the map has been customized, it can be saved and shared.

Result #2: Feature hosted service using a CSV file

URL: http://uwec.maps.arcgis.com/home/webmap/viewer.html?useExisting=1&layers=8ca5b88b0c3e4da4a9fae37b7ecea16f 

The end product of the 'WI_fire_occ_2004_Jeffers' feature hosted service using a CSV file can be seen below (Figure ):
Figure : Wisconsin 2004 fire occurrence feature hosted
service that was created using a CSV file
This is what the service looks like when it is opened in map viewer on ArcGIS Online. This service offers the same functionality as described in the previous feature hosted service result.

Result #3: Feature hosted service using an ArcMap document

URL: http://uwec.maps.arcgis.com/home/webmap/viewer.html?useExisting=1&layers=c63294be4f7c42bbaecf3a61a1001a51 

The end product of the 'Wisconsin_WaterBodies_Service_Jeffers' feature hosted service using an ArcMap document can be seen below (Figure ):
Figure : Wisconsin water bodies feature hosted service
that was created using an ArcMap document
This is what the service looks like when it is opened in map viewer on ArcGIS Online. This service offers the same functionality as described in the previous feature hosted service results.

Result #4: Published ArcGIS Server service using ArcMap

URL: http://www.arcgis.com/home/webmap/viewer.html?url=http%3A%2F%2Fgeog01.uwec.edu%2Fserver%2Frest%2Fservices%2Fjefferap%2FJeffers_Chippewa_Valley_urban_Landuse%2FMapServer&source=sd 

The end product of the 'Jeffers_Chippewa_Valley_urban_Landuse' MapServer service that was published using ArcMap can be seen below (Figure ):

Figure : Chippewa Valley urban land use ArcGIS Server
service that was created using ArcMap
This is what the service looks like when it is opened in ArcGIS Online map viewer except this was accessed through ArcGIS Server as opposed to ArcGIS Online. This service offers similar functionality as described in the previous feature hosted service results.

Result #5: Published ArcGIS Online service using ArcGIS Pro

URL: http://uwec.maps.arcgis.com/home/webmap/viewer.html?useExisting=1&layers=0fdabfa9f40c467d8076b496b2f3cefa

The end product of the 'Chippewa_valley_corridor_Jeffers' tile layer that was published using ArcGIS Pro can be seen below (Figure ):

Figure : Chippewa Valley urban land use ArcGIS Online
tile layer that was created using ArcGIS Pro
This is what the layer looks like when it is opened in ArcGIS Online map viewer. The appearance and functionality is basically the same as the previous result, it was just published using a different method.

Result #6: Feature access and time-enabled service data

URL: http://www.arcgis.com/home/webmap/viewer.html?url=http%3A%2F%2Fgeog01.uwec.edu%2Fserver%2Frest%2Fservices%2Fjefferap%2FNatural_Disasters_AJ%2FMapServer&source=sd

The end product of the 'Natural_Disasters_AJ' MapServer service that was published using ArcMap can be seen below (Figure ):

Figure : U.S. natural disasters (earthquakes and hurricanes)
ArcGIS Server service that was created using ArcMap
This is what the service looks like when it is opened in ArcGIS Online map viewer via ArcGIS Server. The functionality is similar to the previous results. However, there is an added time-enabled functionality which allows users to adjust the time settings and playback of the added features.


Sources

Mastering ArcGIS:

Price, Maribeth Hughett. Mastering ArcGIS. New York: McGraw-Hill Education, 2016.
Wisconsin DNR:


Cyril Wilson:

USGS:

NOAA: