An Open-Source JavaScript Library for Mobile-Friendly Interactive Maps

Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by Vladimir Agafonkin with a team of dedicated contributors. Weighing just about 33 KB of JS, it has all the features most developers ever need for online maps.

Leaflet is designed with simplicity, performance and usability in mind. It works efficiently across all major desktop and mobile platforms out of the box, taking advantage of HTML5 and CSS3 on modern browsers while still being accessible on older ones. It can be extended with a huge amount of plugins, has a beautiful, easy to use and well-documented API and a simple, readable source code that is a joy to contribute to.

Used by: Flickr foursquare Pinterest craigslist Data.gov IGN Wikimedia OSM Meetup WSJ Mapbox CartoDB GIS Cloud

In this basic example, we create a map with tiles of our choice, add a marker and bind a popup with some text to it:

// create a map in the "map" div, set the view to a given place and zoom
var map = L.map('map').setView([51.505, -0.09], 13);

// add an OpenStreetMap tile layer
L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
	attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'

// add a marker in the given location, attach some popup content to it and open the popup
L.marker([51.5, -0.09]).addTo(map)
	.bindPopup('A pretty CSS3 popup. <br> Easily customizable.')

Learn more with the quick start guide, check out other tutorials, or head straight to the API documentation.
If you have any questions, take a look at the FAQ first.

Getting Involved

Third-party patches are absolutely essential on our quest to create the best mapping library that will ever exist. However, they’re not the only way to get involved with the development of Leaflet. You can help the project tremendously by discovering and reporting bugs, improving documentation, helping others on the Leaflet forum and GitHub issues, showing your support for your favorite feature suggestions on Leaflet UserVoice page, tweeting to @LeafletJS and spreading the word about Leaflet among your colleagues and friends.

Check out the contribution guide for more information on getting involved with Leaflet development.