5.5 KiB
layout |
---|
default |
October 25, 2012 — Leaflet 0.4.5 bugfix release and plans for 0.5 — Read More in the Blog
Leaflet is a modern open-source JavaScript library for mobile-friendly interactive maps. It is developed by Vladimir Agafonkin of CloudMade with a team of dedicated contributors. Weighing just about 27 KB of gzipped JS code, it has all the features most devepers 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 being accessible on older ones too. It can also be extended with many plugins, has a beautiful, easy to use and well-documented API and a simple, readable source code that is a joy to contribute to.
{: .usedby} Used by: Flickr foursquare craigslist IGN Wikimedia Meetup WSJ Geocaching StreetEasy Nestoria Topix Chartbeat 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 a CloudMade tile layer with style #997
L.tileLayer('http://{s}.tile.cloudmade.com/[API-key]/997/256/{z}/{x}/{y}.png', {
attribution: 'Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="http://cloudmade.com">CloudMade</a>'
}).addTo(map);
// 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.').openPopup();
Learn more with the quick start guide, check out other tutorials, or head straight to the API documentation.
Contributing to Leaflet
The project is hosted on GitHub, waiting for your contributions --- just send your pull requests to @mourner (Vladimir Agafonkin, Leaflet author and maintainer). Let’s make the best library for maps that can possibly exist!
You can also help the project a lot by reporting bugs on the GitHub issues page, showing your support for your favorite feature suggestions on Leaflet UserVoice page, tweeting to @LeafletJS or joining the Leaflet mailing list.