Additional information about the data and map goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis urna magna, maximus nec laoreet sit amet, dictum ultricies nibh. Ut id auctor lacus. Nam a dolor et justo luctus luctus.
89 |
90 |
Duis a elit eget risus dictum vehicula id eu elit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae. Sed sed enim nisl.
91 |
Additional information about the data and map goes here. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis urna magna, maximus nec laoreet sit amet, dictum ultricies nibh. Ut id auctor lacus. Nam a dolor et justo luctus luctus.
89 |
90 |
Duis a elit eget risus dictum vehicula id eu elit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae. Sed sed enim nisl.
91 |
92 |
93 |
Map authored by me, MY NAME
94 |
95 |
96 |
97 |
98 |
99 |
119 |
120 |
121 |
122 |
--------------------------------------------------------------------------------
/module-01/lesson-01.md:
--------------------------------------------------------------------------------
1 | # Lesson 01. Drawing Data with Web Maps
2 |
3 | To begin, clone or [download the course repository](https://github.com/rgdonohue/web-mapping-short-course) to your computer.
4 |
5 | Clone or unzip the contents of the files in a known location (i.e., a directory in your Documents). Briefly, examine the contents of the directory named *module-01/*. You notice a directory named *leaflet-map-template/* that contains an HTML document named *index.html*.
6 |
7 | ## Setting up a development environment
8 |
9 | There are many [lessons and resources](http://maptime.io/lessons-resources/) available on the web for getting started with web mapping. But often, getting the development environment set up so you can write code and test your map is the first roadblock. Let's consider the principle components of a web development process. These are what you need to have available every time you begin web map design and development.
10 |
11 | **A Web Browser**
12 |
13 | Web Mapping is an unusual form of Cartography in that we primarily make the maps using the same medium with which we develop them. The web browser is a crucial component of our technology stack. Most web map developers use Chrome or Firefox, as should you. Make sure you have installed recent updates to your browser, and begin by opening your Web Browser.
14 |
15 | **A Text Editor**
16 |
17 | Developers build web maps by writing plain text. Text editors designed for web development facilitate this, particular by highlighting different parts of the code syntax. Install and open one of the following:
18 |
19 | * [Brackets](http://brackets.io/)
20 | * [Sublime](https://www.sublimetext.com/)
21 | * [Atom](https://atom.io/)
22 |
23 | Brackets is particularly handy if you don't have a local server running or don't know what that is. Its "Live Preview" functionality runs a local test server within your web browser, which allows you to see and test your rendered web application.
24 |
25 | **Directories, Files, Data, and Media**
26 |
27 | The user's web browser assembles and renders the web page and map application using specific files. Minimally this will include an HTML index file for the direction, typically named *index.html*.
28 |
29 | Using your text editor, open the *module-01/* directory so you can view the entire structure. A good text editor allows you view and modify the contents of the directory. Again examine the contents of this directory from within the editor.
30 |
31 | 
32 | **Figure 01.** Viewing the directory file structure and files in Brackets.
33 |
34 |
35 | **A Web Server**
36 |
37 | While a web browser application interprets and renders the files that compose our web maps, it doesn't do this by itself. It requires a "server" to gather the files and deliver them to the browser correctly. A server is especially necessary when using JavaScript to make what are known as [asynchronous requests](http://rowanmanning.com/posts/javascript-for-beginners-async/) to load files and data into our web application after the web page initially loads.
38 |
39 | We develop a web application "locally" on our computer, so it's best to use a local server, or a "local test server," to do this. There are a few options for getting a local test server running on your machine.
40 |
41 | 1. [Python's SimpleHTTPServer](http://www.pythonforbeginners.com/modules-in-python/how-to-use-simplehttpserver/) module
42 | 2. A [WAMP server](http://www.wampserver.com/en/) for Windows or a [Mac OS alternative](http://ampps.com/download)
43 | 3. The use of [Brackets](http://brackets.io/) text editor (see above)
44 |
45 | Once you get a local server running within your browser, open the *leaflet-map-template/index.html* file (or open this file from within Brackets using the Live Preview). Note that Brackets will launch a new instance of your default web browser application.
46 |
47 | **Web Developer Tools**
48 |
49 | Modern web browsers come installed with web developer tools. These tools come loaded with functionality allowing you to investigate how a web page or application is structured and performing within your browser. Read more about using the [Chrome DevTools](https://developer.chrome.com/devtools), and as always look for the shortcuts to open and close the toolbar in your browser (Cmd + i in Mac OS).
50 |
51 | Open your web developer toolbar.
52 |
53 | 
54 | **Figure 02.** Opening Chrome's Web Developer Tools.
55 |
56 | You can use the Elements tab of the Developer tool to inspect the DOM as it is rendered within the browser. While this will largely mirror the HTML document itself, the rendered DOM will also contain elements dynamically produced with JavaScript when the page loads.
57 |
58 | 
59 | **Figure 03.** Exploring the DOM elements using Chrome's Web Developer Tools.
60 |
61 | One of the most useful features is the [Console](https://developer.mozilla.org/en-US/docs/Web/API/Console), which allows you to log JavaScript values within the browser. You can type directly into the Console, or log values from a JavaScript file loaded within the browser. We'll be doing both as we build and debug web maps.
62 |
63 |
64 | ## Introducing the building blocks of a "hello world" web map template
65 |
66 | Let's begin with a simple working template for making a web map.
67 |
68 | Open the *leaflet-map-template/index.html* file within your browser. Be sure to open your file using the Live Preview of Brackets or using another local server.
69 |
70 | If the map loads correctly, you should see a light basemap centered on the Guggenheim Geography building within Boulder, CO. A marker is located at this location and a tooltip opens on the marker. There should also be no errors in the Developer Tool Console.
71 |
72 | 
73 | **Figure 04.** The Leaflet map templete loaded in the browser, with no errors in the Console.
74 |
75 | How does the code contained within the *index.html* file work together to produce this map? Our web document is composed of 3 essential web technologies: HTML, CSS, and JavaScript. The web browser in turn creates a DOM or Document Object Module using this document.
76 |
77 |
78 | ### HTML (structure)
79 |
80 | The HTML structures and describes the content of our document. Some of its elements (`
100 |
101 |
102 |
103 |
104 |