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:

Thursday, September 21, 2017

Web GIS Lab 1: Cloud GIS Basics

Goal and Background

This lab introduces students to some basic components of web maps. Students get an idea of what creating a simple web map from a "developer's" perspective is like and what its functionalities look like from a consumer user's point of view. It also introduces students to the creation of a story map which will be created using ArcGIS Online for Organizations. 

A story map tour allows a user to take a "tour" of a specific geographic location by "walking through" a sequence of photos that are linked to a map. 

There are three parts to building a story map via ArcGIS Online:
  1. Create and share a web map application template
  2. Creation of service for photographs and finalize story map
  3. Launch the application

Methods

Building a Story Map via ArcGIS Online

Create and share a web map application template

> Sign in to ArcGIS Online by first going to https://www.arcgis.com/home/index.html and clicking on 'Sign In' in the upper right corner (figure 1); click on 'Sign in with Enterprise Account' (figure 2); type in 'uwec' and click 'Continue' (figure 3); click on 'Using Your University of Wisconsin - Eau Claire Account' (figure 4); then log in using your UWEC user name and password and you will be directed to the home page.

Figure 1: 'Sign In' home page
Figure 2: 'Enterprise Account' sign in
Figure 3: UWEC sign in
Figure 4: UWEC personal account sign in

> Next, create a new web map by first clicking on 'Map' from the home page followed by 'Basemap' and then select 'Terrain with Labels' (figure 5).

Figure 5: Basemap selection

> Zoom into Texas with Austin in the center of the map. Save the map and fill in the blanks with the following information (figure 6):

     Title: Geog 368 Texas field trip_YourLastName
     Tags: Field trip, Texas, Geography
     Summary: Field activities carried out in Texas

Figure 6: Save map

> Click on 'Save Map' to save it. Go to 'My Content' and find the map that was just created. Click on the Texas web map which will then bring you to the overview and other information about the map.

> Click on 'Create Web App > Using a Template' toward the upper right hand side. This will then reveal numerous application templates from which to choose. Select the 'Story Map Tour' from the gallery then click 'Create Web App' (figure 7).

Figure 7: Select web app template

> The information entered in earlier when the map was initially saved automatically shows up. Type in a suitable summary then click on 'Done'. Next, the Map Tour Builder will pop up (figure 8).


Create and share a web map application template

> The Texas photos must now be uploaded to ArcGIS Online. Click on the 'ArcGIS' icon on the right side of the Map Tour Builder followed by clicking on 'Create the layer'.

Figure 8: Map Tour Builder window

> After the service is created, the map will be visible on the right side of the screen with a blank section on the left side where the photos will be uploaded. Click 'Add' (figure 9) to bring up the 'Add a new tour point' window (figure 10). Photos for this map are located in the 'Lab1data' folder found on D2L. There are 10 photos in the 'StoryMapData' folder that will be uploaded to ArcGIS online to be used in the story map.

Figure 9: Add photo

Figure 10: 'Add a new tour point' window

> Click on 'Select or drop picture' and locate the folder containing the Texas photos. Select 'Photo_1.jpg' which will now appear in the window (figure 11).

> Some information needs to be added in both the 'Information' and 'Location' tabs. Click on the 'Information' tab. Open the word document titled 'Photo information' in the 'Lab1data' folder. Type in the subsequent 'Name' and 'Caption' information.

Figure 11: Window with added photo

> Next, click on the 'Location' tab. Since the photo was not geotagged in the field, the latitude and longitude will need to be entered manually. Enter the subsequent latitude and longitude in the 'Latitude' and 'Longitude' boxes (figure 12). Once this is entered, click 'Add tour point'. The photo is now added and the location appears on the map.

Figure 12: Location tab

> Follow the same procedures for the remaining photos (photos 2-10). Once all photos have been added, the application should look similar to the one below (figure 13). 

Figure 13: Story map with all photos added

Launch the application

> Click the 'Save' button at the top of the screen then click 'Share'. After the story map tour is shared, click 'Open' in the 'Share your Tour' window to launch the finalized tour.

Results

The final story map tour looks similar to figure 13 but does not feature the 'Application Configuration' buttons (figure 14). This tour can be found at the following URL:

http://arcg.is/2jDMNjr

Figure 14: Final story map tour

The tour allows user to view the photos in a number of ways including:
  1. Clicking on the arrows that appear on either side or both sides of the large photo on the upper left hand side of the screen
  2. Clicking on any photo in the row of small photos on the bottom of the screen (these photos also show the number of the photo in the upper left corner)
  3. Clicking on the colored numbers on the map (numbers are associated with their respective photo)
When a photo is selected, the name and caption appears on the large photo itself, and a button appears in the upper right corner of the photo that allows the viewer to view a larger version of the photo by itself. The name also appears above the associated photo number located on the map. Overall, viewers can easily navigate photos of the tour from start to finish or jump around from photo to photo.

On the map, users can zoom in and out to get a good sense of where exactly the tour is located and gather a good understanding of the distances between photo locations and where they appear in respect to each other. 


Sources

ArcGIS Online: https://www.arcgis.com/home/index.html