ADVANCED: Making maps with Leaflet.js

Slides:



Advertisements
Similar presentations
1 Web Site Design Overview of the Internet Cookie Setton.
Advertisements

Making maps with Leaflet.js Steve Signell, Instructor Robert Poirier, TA School of Science Rensselaer Polytechnic Institute.
Creating and Editing a Web Page Using Inline Styles
Making maps with Leaflet.js Part II
Using Advanced Cascading Style Sheets
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Create Your Own Webpage. Today’s Agenda Cut & paste code Notepad++ or Notepad at home FTP Web Hosting Wordpress.
Creating a Web Page HTML, FrontPage, Word, Composer.
LEARN THE QUICK AND EASY WAY! VISUAL QUICKSTART GUIDE HTML and CSS 8th Edition Chapter 2: Working with Webpage Files.
Copyright 2007, Information Builders. Slide 1 Maintain & JavaScript: Two Great Tools that Work Great Together Mark Derwin and Mark Rawls Information Builders.
Using Dreamweaver. Slide 1 Dreamweaver has 2 screens that do different things The Document window where you create your WebPages The Site window where.
Making an HTML Document Notepad Group Bo Kim Dan Carter Han Chong Justin Weaver Kris Lamont.
© Ms. Masihi.  The Dreamweaver Welcome Screen first opens when you start Dreamweaver.  This screen gives you quick access to previously opened files,
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Dynamic Action with Macromedia Dreamweaver MX Barry Sosinsky Valda Hilley.
Web Design Unit Assignment #2: Job Skills Favorite Links Page You will create a HTML web page with links to informational websites about a variety of job.
What is Museum Box? A Museum box is a way of presenting information that allows you to create a cube project that can be shared with others. You can use.
Using FrontPage Express. Slide 1 Standard toolbars and menus Time indicator: gives an approximation of download time of the page.
DREAMWEAVER Adding photos and other tips!. Making photo gallery  Gather ALL the photos you need into your images folder. (remember to copy the URL so.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Internet Browsing the world. Browse Internet Course contents Overview: Browsing the world Lesson 1: Internet Explorer Lesson 2: Save a link for future.
Processing.js.
JAOIT 8.  Dreamweaver is a program for creating web pages and managing websites without having to type HTML code.  WYSIWYG – What you see is what you.
ASP Introduction Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Tutorial: Using ArcGIS Server and ESRI ArcGIS API for Javascript Peter Sforza March 7, 2013.
University of Sunderland CDM105 Session 6 Dreamweaver and Multimedia Fireworks MX 2004 Creating Menus and Button images.
Lecture Note 1: Getting Started With ASP.  Introduction to ASP  Introduction to ASP An ASP file can contain text, HTML tags and scripts. Scripts in.
Sports Website Creation. In this project you will design and produce your own website.
Mrs. Knopp Library Media Specialist.  The term wiki comes from the phrase Wiki- Wiki which is the Hawaiian word for quick.  A wiki is a website that.
MapInfo Professional 11.0: getting started Xiaogang (Marshall) Ma School of Science Rensselaer Polytechnic Institute Friday, January 25, 2013 GIS in the.
Web Foundations WEDNESDAY, NOVEMBER 20, 2013 LECTURE 32: DREAMWEAVER SLIDE SHOW AND GOOGLE MAP.
Troubleshooting: Web maps & Joins Steve Signell, Instructor Robert Poirier, TA School of Science Rensselaer Polytechnic.
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
Photoshop Image Slicing. Reasons to Image Slide To create links out of sliced images To optimise different areas. (flat areas of colour, such as logos,
AGB 3/26/121 ++=. 2 Yes, believe it or not this is a complete webpage. It has a Head, Title and Body between the start and end HTML Tag.
WDMD 170 – UW Stevens Point 1 WDMD 170 Internet Languages eLesson: Variables, Functions and Events (NON-Audio version) © Dr. David C. Gibbs WDMD.
Web Authoring with Dreamweaver. Unit Objectives  Be able to define keywords: HTML, HTTP (protocol), browser, web server, client/server, tag, attribute,
Creating and Editing a Web Page Using Inline Styles
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Creating Web Pages with Links, Images, and Embedded Style Sheets
Adding a Picture in ArcGIS. Getting Started Open ArcMap in ArcGIS Add shape files Find pictures on the web save in folder with shape files you added to.
Microsoft Expression Web - Illustrated Unit A: Getting Started With Microsoft Expression Web.
Basic HTML Page 1. First Open Windows Notepad to type your HTML code 2.
Let’s Try It! Open Notepad
Weebly Elements, Continued
Introduction to working with Weebly
ADVANCED: Troubleshooting: Web maps & Joins
Images in HTML PowerPoint How images are used in HTML
2 At the top of the zone in which you want to add the Web Part, click Add a Web Part. In the Add Web Parts to [zone] dialog box, select the check box of.
Adapting Files On A “Visual Webpage” (Ver /mb)
JavaScript “Hello World” in Microsoft Visual Studio 2013
2 At the top of the zone in which you want to add the Web Part, click Add a Web Part. In the Add Web Parts to [zone] dialog box, select the check box of.
Tutorial: How to Creat a Website.
DW Tutorial 5 Sessions 5.1 & 5.2 REVIEW
Chapter 4 Adding Images.
MapServer In its most basic form, MapServer is a CGI program that sits inactive on your Web server. When a request is sent to MapServer, it uses.
ADVANCED: Making maps with Leaflet.js Part II
Introduction to ArcGIS 9
Basic HTML and Embed Codes
Introduction to Google Maps
Embedding Graphics in Web Pages
Intro to Web Development First Web Page
Creating your first website
Using FrontPage Express
Creating your first website
Client-Server Model: Requesting a Web Page
Introduction to JavaScript
Creating dynamic/interactive web pages
Images in HTML PowerPoint How images are used in HTML
Presentation transcript:

ADVANCED: Making maps with Leaflet.js GIS in the Sciences ERTH 49xx ADVANCED: Making maps with Leaflet.js Peter Fox (pfox@cs.rpi.edu), adapted from Steve Signell School of Science Rensselaer Polytechnic Institute Week 11, 2016

Leaflet.js Leaflet.js: An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps: http://leafletjs.com Javascript is embedded in an .html file What is an .html file?

Before we start, we must: Download & Install the Sublime Text 3 text editor: http://www.sublimetext.com/3 Next we will create a webserver on your machine: What is a webserver? A folder on your machine that can be viewed accessed via a web browser.

PgAdmin/Postgres Installed? Open Application Stack Builder and select Web DevelopmentApache/PHP. Direct your browser to ‘localhost:800’– does it show a message from Apache? If not, ask for help and we’ll find it. The folder containing your web server MAY be something like ‘Program Files\ApachePHP\apache\www’ If not, ask for help and we’ll find it. Copy the ‘giscience_leaflet_template’ folder into your webserver folder. Now open up your browser again and paste ‘/ giscience_leaflet_template ‘ onto the end of the URL: You should see something like this:

OpenGeo Suite installed? Open up your OpenGeo Suite Dashboard and note the URL. It will probably be something like ‘localhost:8080’ On windows, the folder containing your web server MAY be something like ‘Program Files\Boundless\OpenGeo\jetty\webapps.’ If not, ask for help and we’ll find it. Copy the ‘giscience_leaflet_template’ folder into your webserver folder. Now open up the OpenGeo Dashboard again and paste ‘/ giscience_leaflet_template ‘ onto the end of the URL: You should see something like this:

Explore your folder Open the helloworld.html file, and then right-clickView Page Source Do the same with leaflet_template.html Open the data and img folders and explore their contents. how are GeoJSON files structured? (‘JSONView’ is a nice little Chrome/Firefox extension that helps you decipher GeoJson files.)

Parts of a Leaflet Map Script files Map area Zoom tool layerControl data

Edit your html Open your helloworld.html in Sublime Text 3, and modify the text between the ‘title’ and ‘body’ tags. Make sure you save it, and then reload the webpage in your browser. Did anything change? Open leaflet_template.html in Sublime Text, and make the following changes. After each step, save the file and then check the effect by refreshing the page in your browser. Change the title (line 5) Make the map a square shape (line 16) Change the initial zoom from 9 to 8 (line 26) Change the color of the borough boundaries from black to red (line 47) Change the default basemap from OpenStreetMap to NAIP (line 63) Change the name of the boroughs in the layerControl from ‘Boroughs’ to ‘NYC Boroughs’ (line 73)

Add another overlay layer Add another overlay layer by adding the following text to leaflet_template.html, after the boroughs data gets loaded (line 60): //make a variable for the museums layer and set the style var museums = L.geoJson(null, { pointToLayer: function (feature, latlng) { return L.marker(latlng, { icon: L.icon({ iconUrl: "img/museum.png", iconSize: [24, 28], iconAnchor: [12, 28], popupAnchor: [0, -25] }), title: feature.properties.NAME, riseOnHover: true }); } //load the museums data from geojson $.getJSON("data/museums.geojson", function (data) { museums.addData(data); Also add the ‘museums’ layer to the overlays in your layerControl.

Add your own layer Use QGIS to save the nyc_subway_stations layer as a GeoJSON file in your /data folder. Make sure you reproject the data from UTM18N to WGS84 (EPGS:4326). Add the subways stations layer to the map by copying and modifying the code from the previous slide. Don’t forget to your new layer to the layerControl. Optionally, you can also load it onto the map by default. Find a more appropriate .jpg or .png image for subway stops and save it to your /img folder. Then change the ‘iconURL’ so it points to this new image. If you want some text to appear when you hover over the feature, you’ll have to change the ‘title: feature.properties.NAME’ to point to a field name that exists in your geojson (this is case sensitive).

Self-paced work Experiment with adding more layers and with the tutorials at leaflet.js.com. Create a new .html file that creates a leaflet map of the RPI area and include one or more layers from your group or individual project.