Introduction To Leaflet.js

Slides:



Advertisements
Similar presentations
Samsung Smart TV is a web-based application running on an application engine installed on digital TVs connected to the Internet.
Advertisements

Making maps with Leaflet.js Part II
TileMill Quickly and Easily Design Maps for the Web Shaky Sherpa Matt Berg Modi Research Group The Earth Institute. Columbia University.
An introduction to WebGL Viktor Kovács. Content A little 3D modeling. What is WebGL? Introducing Three.js. Visualizing GDL objects.
JQuery. What is jQuery? jQuery is a fast, small, and feature-rich JavaScript library that simplifies HTML document traversing and manipulation event handling.
Philly.NET Hands-On jQuery + Plug-ins Bill Wolff, Rob Keiser.
XML on the Web: is it still relevant? O'Neil D. Delpratt.
Definition from Wikipedia.  The Prototype JavaScript Framework  implemented as a single file of JavaScript code  named prototype.js (
Working with Cascading Style Sheets. Introducing Cascading Style Sheets Style sheets are files or forms that describe the layout and appearance of a document.
Learning & Development Telerik Software Academy.
INTRODUCTION TO HTML5 Styling with CSS3. Round Border Corners  You can modify any element that supports the border property and render rounded borders.
Images (1) Three most popular formats – Graphics Interchange Format (GIF) – Joint Photographic Experts Group (JPEG) – Portable Network Graphics (PNG) –
Styling and theming Build campaigns in style. What we'll look at... How a web document is structured How HTML and CSS fit together Tools you will need.
JavaScript Programming B.Ramamurthy 6/113/2014B. Ramamurthy CSE6511.
SEG3210 DHTML Tutorial. DHTML DHTML is a combination of technologies used to create dynamic and interactive Web sites. –HTML - For creating text and image.
Cross Site Integration “mashups” cross site scripting.
Mobile web Sebastian Lopienski IT Technical Forum 29 June 2012.
Unleash the Power of jQuery Doncho Minkov Telerik Software Academy academy.telerik.com Senior Technical Trainer
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
Chapter 2 The Mechanism behind Extensions. How “Extensions” are implemented.
SASS & LESS Syntactically Awesome StyleSheets Dynamic StyleSheet Language Svetlin Nakov Technical Trainer Software University
Web Foundations WEDNESDAY, NOVEMBER 20, 2013 LECTURE 32: DREAMWEAVER SLIDE SHOW AND GOOGLE MAP.
Using Google Maps Sunday 9th Sept H.A. Nandalal, TTLS
Esri UC 2014 | Technical Workshop | ArcGIS API for JavaScript: What’s New Derek Swingley Jerome Yang
CONFIDENTIAL - 1 USTUDIO HTML5 PLAYERS. CONFIDENTIAL - 2 Power Any Experience 2.
Follow Up. Can one change the appearance of the alert/confirm/prompt box? The default Alert box can be customized (or over-ridden) by JavaScript + CSS.
When I am embedding under, I do not close the li tag until I complete the items that are embedded. Looking at outlines.
NASRULLAHIBA.  It is time to take your web designing skills to the next level with Cascading Style Sheets (CSS). They are a way to control the look and.
Let’s look what flash can do: OK, that wasn’t flash! That was HTML5.
Open-Source JavaScript Maps with Leaflet Will Abson
CSCI 3100 Tutorial 2 Web Development Tools 1 HTML 5 & CSS 3 1.
OpenLayers Prof. Wenwen Li School of Geographical Sciences and Urban Planning 5644 Coor Hall
CSCI 3100 Tutorial 5 JavaScript & Ajax Jichuan Zeng Department of Computer Science and Engineering The Chinese University of Hong.
The HTML5 logo was introduced by W3C in 2010
Working with Links and Navigation
CSCI 1720 W3.CSS – Part 1 East Tennessee State University Department of Computing CSCI 1720 Intermediate Web Design.
Programming Web Pages with JavaScript
Mapping for the interwebs
Geographic Search & Display
ADVANCED: Making maps with Leaflet.js
Visualizing Traffic Stress Data for Local Cyclists
Google fonts CSS box model
Personal Website Final Project
ADVANCED: Troubleshooting: Web maps & Joins
Map Mashups Peterson’s Chapter 10.
Matthew Przyborski Sam Moore GEO244 April 27, 2017
© 2016, Mike Murach & Associates, Inc.
Introduction to Web programming
APIs (and their Relatives) Can Expand and Unify Library Services
Web Systems & Technologies
°.
Introduction to D3.js and Bar Chart in D3.js
TOPICS Chrome Dev Tools Process for Building a Static Website
AMP.
HEATHER HALL & ADRIENNE SPITZER
ADVANCED: Making maps with Leaflet.js Part II
Mapbox Studio Sarah and Haley.
Introduction to Programming the WWW I
An Intro to Leaflet.js Matt Anderson.
Cascading Style Sheets (Introduction)
JavaScript Programming Labs
Types of Spatial Data Sites
Javascript.
CSS Styles Introduction.
Exercise 9 Skills You create and use styles to create formatting rules that can easily by applied to other pages in the Web site. You can create internal.
Types of Spatial Data Sites
Types of Spatial Data Sites
Introduction to JavaScript & jQuery
Geographic Search & Display Updates & Development Plans
© 2017, Mike Murach & Associates, Inc.
Presentation transcript:

Introduction To Leaflet.js Alireza Mohammadi Sahar Nafisi Advisor: Dr.Vahidipour

Introduction to Leaflet JS What is leaflet.js “An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps” LeafletJS.com Contribute on GitHub Introduction to Leaflet JS

Introduction to Leaflet JS Who uses leaflet js? Introduction to Leaflet JS

Introduction to Leaflet JS Features Extremely lightweight around 34 KB of gzipped JS code No external dependencies Lots of features, plugins, more coming! Modern, standards-based, mobile-friendly Uses HTML5 and CSS3 Pure CSS3 popups and controls (easy Styling) Use any map Provider (OSM, MapBox, Google, ...) Browser Support works in IE7 Open Source and others … Introduction to Leaflet JS

an alternative for Google Maps? NO ! Introduction to Leaflet JS

an alternative for Google Maps? (cont.) The two are not comparable Google maps gives an API for developers to use interactive maps in theirs applications Leaflet js provides a tool for developers and data scientists to display data on the map, it uses map providers API like google maps, map box and ... at the behind Introduction to Leaflet JS

Introduction to Leaflet JS Install it Link to the StyleSheets CDN Link to the JS CDN Add a map div (or several) Set a height for the map Introduction to Leaflet JS

What is Geo J S O N? { "type": "Feature", "properties": { "name": "Coors Field", "amenity": "Baseball Stadium", "popupContent": "This is where the Rockies play!" }, "geometry": { "type": "Point", "coordinates": [ -104.99404, 39.75621 ] } Some data with JSON format that contains geographical information Introduction to Leaflet JS

Example p1 (US States Population Density) { "type": "Feature", "properties": { "name": "Alabama", "density": 94.65 }, "geometry": { "type": "Polygon" "coordinates": ... } An array of coordinates that encloses a geographic area Introduction to Leaflet JS

Example p2 (add map in js code) Map center coordinates Zoom level var map = L.map('map').setView([37.8, -96], 4); L.tileLayer('https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw', { maxZoom: 18, id: 'mapbox.light' }).addTo(map); Introduction to Leaflet JS

Example p3 (Adding Some Color) function getColor(d) { return d > 1000 ? '#800026' : d > 500 ? '#BD0026' : d > 200 ? '#E31A1C' : d > 100 ? '#FC4E2A' : d > 50 ? '#FD8D3C' : d > 20 ? '#FEB24C' : d > 10 ? '#FED976' : '#FFEDA0' ; } Introduction to Leaflet JS

Example p4 (add some styles) function style(feature) { return { fillColor: getColor(feature.properties.density), weight: 2, opacity: 1, color: 'white', dashArray: '3', fillOpacity: 0.7 }; } L.geoJson(statesData, { style: style }).addTo(map); Features of border around any state Introduction to Leaflet JS

Introduction to Leaflet JS Final result Introduction to Leaflet JS

Thank you Any questions? Introduction to Leaflet JS