Learn.js #3
Learn.js #3
Minimum price
Suggested price
Learn.js #3

Last updated on 2014-05-28

About the Book

Leaflet.js is an awesome, easy to learn mapping library. In this book we’ll go through some introductory examples so you can get started using it in your projects. We’ll also use data from various public sources like open government data, social networks and geographically-aware wiki to create interactive maps.

We’ll be using Leaflet.js as a module in the node.js/CommonJS style, utilizing browserify to bundle the code for the browser. We’ll also explore a wide range of tilesets available for use in Leaflet.js maps.

The reader

The ideal reader for this book is someone who likes exploring, imagining, and inventing for themselves. You probably have some experience with javascript already, and you’d like to learn more about animation using the canvas tag, basic game development patterns, and gain intermediate skills in developing javascript modules that can be used on the server and in the browser.

Goals of the book

You’ll learn:

  • The basics of creating maps with Leaflet.js.
  • Creating interactive, filterable maps.
  • Using alternate tilesets and image overlays with your maps.
  • Integrating maps with public APIs and datasets.
  • Using browserify to bundle node.js-style modules for the browser.
  • Intermediate node.js module creation and best practices.
  • Using developer tools like Git, GitHub, Chrome Dev Tools, Bower, npm, and Grunt.

Read a sample here: learnjs.io/blog/2013/11/08/leaflet-basics

Free updates

This book is under active development. You’ll get all future updates for free.

About the Author

Seth Vincent
Seth Vincent

Seth Vincent is a programmer, designer, and writer focused on journalism and civic technology projects. Previously he’s worked as an advisor of a student news organization, advising on technology, journalism, and leadership. He is a co-organizer of Code for Seattle, a volunteer organization associated with Code for America, that uses technology to support civic engagement and address local issues.

Table of Contents

  • Introduction
    • Thank you.
    • Tools we’ll use in this book
    • Chapters
    • Who are you? Who am I? What is this?
    • Setting up a development environment
  • The simplest possible map you can make
    • Get a MapBox account and map ID
    • Create an index.html file
    • The full index.html file explained in detail
    • Add a marker
    • Publish the map on GitHub Pages
  • Getting started with Leaflet.js using node.js, npm, and browserify
    • Installation and setting up
    • Serving the development site using browserify & beefy
  • Basic elements of a Leaflet.js map
    • UI Layers
    • Vector layors
  • Using alternate tilesets
    • Get set up
    • Install the leaflet-providers module
    • Using Stamen tiles
    • Using Mapbox tiles
    • Using alternate CloudMade tiles
  • Useful Leaflet.js plugins
    • leaflet-omnivore
    • Leaflet.markercluster
    • Leaflet.label
    • Leaflet.awesome-markers
    • Leaflet.TextPath
    • leaflet-hash
    • L.GeoSearch
    • Leaflet.draw
    • leaflet-search
  • Drawing shapes on a Leaflet map
    • Getting started
    • Basic CSS & HTML
    • Edit index.js
    • Saving GeoJSON to a database
    • Install xhr for browser.js
    • Revise browser.js
  • A Work in progress
    • The planned upcoming chapters:
  • Changelog
    • v0.2.0 - February 3, 2014
    • v0.1.0 - November 18, 2013

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms...

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub