diff --git a/leaflet-geocoder.md b/leaflet-geocoder.md index 528ee76..7c57518 100644 --- a/leaflet-geocoder.md +++ b/leaflet-geocoder.md @@ -12,23 +12,22 @@ The Leaflet JavaScript library, which provides tools for zooming, displaying att To set up your development environment for this walkthrough, you need to download the geocoder plug-in. You do not need to download the Leaflet files because you will be referencing them from a web server. -1. Create a new folder on your machine named `geocoding-tutorial`. You will use this folder as your working directory. -3. Download the dependent files necessary to complete the walkthrough. They have been zipped for you. -4. Unzip any zipped files. +1. Download the dependent files necessary to complete the walkthrough. +4. Unzip any zipped files. They should unzip to a folder named geocoding-tutorial. ![Downloaded and unzipped folder](images/geocoder-plug-in-files.png) -6. Make sure your geocoding-tutorial folder has an images folder, leaflet-geocoder.css, and leaflet-geocoder.js files, and well as two HTML files. +5. Make sure your geocoding-tutorial folder has an images folder, leaflet-geocoder.css, and leaflet-geocoder.js files, and well as two HTML files. ![Files needed for the walkthrough](images/geocoder-dist-folder.png) ## Create an index page -Now that you have downloaded the required dependent files, you are ready to start building your application. This example uses the simplest structure, a single index.html file. This file was created for you with the basic HTML tags. +Now that you have downloaded the required dependent files, you are ready to start building your application. You will need to use a text editor to update the HTML. -`index.html` is the file you will be editing, while `index-complete.html` is a completed version that you can use to check your work or review if you need to troubleshoot an error. +Suggested text editor applications include Atom, Notepad++, and Sublime. While you can use the ones installed with your operating system, such as Notepad or TextEdit, they do not provide the helpful indentations or code alignments found in the other editors. For TextEdit, you must go to the Format menu and click Make Plain Text to use the plain-text version of the file. Do not use an app that applies rich formatting, such as Word or Wordpad. -Some common text editor applications include Atom, Notepad++, Sublime. You can use the apps installed with your operating system, such as Notepad or TextEdit, but they do not provide the helpful indentations or code alignments that are available in the other apps. If you do use TextEdit, you must go to the Format menu and click Make Plain Text to use the plain-text version of the file. Do not use an app with any rich formatting, such as Word or Wordpad. +The geocoding-tutorial folder contains two HTML files: `index.html` is the file you will start with and update in the steps, while `index-complete.html` is a finished version to check your work or review if you need to troubleshoot an error. 1. From your geocoding-tutorial folder, open index.html in a text editor. It should look like this: @@ -65,11 +64,9 @@ You HTML should look like this: ``` -As you are working, it’s a good idea to save your edits and periodically reload the browser page. This helps you identify problems quicker and trace them back to your most recent changes. - ## Add references to CSS and JavaScript files -Because you are working with several external cascading style sheet (CSS) and JavaScript files, you need to add references to them in your index.html file. These include style sheets and JavaScript files for Leaflet and the geocoder. You will need to add these into the `` and `` sections of the index.html. +Because you are working with several cascading style sheet (CSS) and JavaScript files for Leaflet and the geocoder, you need to list them in your index.html file. You will need to add these into the `` and `` sections of the index.html. 1. In index.html, at the bottom of the `` section, add references to the Leaflet CSS and JavaScript files. You are referencing these from a website, rather than from a file on your machine. @@ -78,7 +75,7 @@ Because you are working with several external cascading style sheet (CSS) and Ja ``` -2. In the `` section, immediately after the Leaflet lines, add references to the geocoder CSS and JavaScript files. These files are from the GitHub repository you copied to your machine. +2. In the `` section, immediately after the Leaflet lines, add references to the geocoder's CSS and JavaScript files. These files are from the GitHub repository you copied to your machine. ```html @@ -136,9 +133,9 @@ To display a Leaflet map on a page, you need a `
` element with an ID value, ``` - `L.xxxxx` is a convention used with the Leaflet API. The `setView([37.804146, -122.275045], 16)` sets the center of the map, in decimal degrees, and the zoom level. The map is centered at the Maptime Oakland meeting location, with a zoom level that allows you to see the streets and features of the city. Zoom levels are similar to map scales or resolutions, where a smaller value shows a larger area in less detail, and a larger zoom level value depicts smaller area in great detail. + `L.xxxxx` is a convention used with the Leaflet API. The `setView([37.804146, -122.275045], 16)` sets the center of the map, in decimal degrees, and the zoom level. The map is centered at the MaptimeOAK meeting location, with a zoom level that allows you to see the streets and features of the city. Zoom levels are similar to map scales or resolutions, where a smaller value shows a larger area in less detail, and a larger zoom level value depicts smaller area in great detail. -4. Within the same `