Top Banner
Building Maps with Jereme S. Causing
19
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building Maps with Leaflet

Building Maps with

Jereme S. Causing

Page 2: Building Maps with Leaflet

2

What is Leaflet.js and Why choose it?

Page 3: Building Maps with Leaflet

What is leaflet.js?

Leaflet.js is an open source Javascript library used to build web mapping applications

Page 4: Building Maps with Leaflet

The Problems with Maps

• Usage Limits • Limited to provided map• Google is in control

Page 5: Building Maps with Leaflet

Why Leaflet.js

• Fast Performance• Lightweight (only 123kb)• Customizable• Easy to Learn• Easy Migration (for Google Maps API users)• Mobile-Friendly

Page 6: Building Maps with Leaflet

Getting Started

Page 7: Building Maps with Leaflet

Tiles• In creating a map, you always start from

selecting your tile source.• There are a number of online services that

provide tiles.–Cloudmade–Mapquest–Openstreetmap–Bing

• As a matter of fact, you can also provide your own tiles

Page 8: Building Maps with Leaflet

Who uses leaflet.js

• Flickr• Foursquare• Pinterest • IGN• OpenStreetMap• craigslist

Page 9: Building Maps with Leaflet

Creating a Basic Map

Page 10: Building Maps with Leaflet

10

Stylesheet…

Include the files (either download or use cdn)

Page 11: Building Maps with Leaflet

Html…

…and Javascript code

Page 12: Building Maps with Leaflet

Markers

DemoDemo2 (Custom Icons)

Page 13: Building Maps with Leaflet

Shapes

• Shapes like circles and polygons are also supported

Page 14: Building Maps with Leaflet

Layer Control

Page 15: Building Maps with Leaflet

Getting Location

Page 16: Building Maps with Leaflet

Custom Tiles

As mentioned earlier, you can also provide your own tiles

• Skyrim• The Forest(fan map)• Olivarez Maps(thesis)

Page 17: Building Maps with Leaflet

Events

• Leaflet supports a variety of events from click to touch interaction for mobile devices.

Demo

Page 18: Building Maps with Leaflet

PluginsLeaflet.js also comes with a number plugins to suit your needs

• Marker Clustering• Drawing Tools• Heatmaps• Font-Awesome Markers• Animation

Page 19: Building Maps with Leaflet

Thank You