OpenStreetMap plugin for Leaflet
Switch branches/tags
Nothing to show
Clone or download

leaflet-osm is a Leaflet plugin for rendering tile and vector data from

For example, the website could use it to highlight a particular way or node on the base map.

Usage Examples

Tile Layers

new L.OSM.Mapnik().addTo(map);

// L.OSM.CycleMap and L.OSM.TransportMap require an API key:
new L.OSM.CycleMap({apikey: '...'}).addTo(map);
new L.OSM.TransportMap({apikey: '...'}).addTo(map);

Data Layer

  url: "",
  // or ""
  dataType: "xml",
  success: function (xml) {
    var layer = new L.OSM.DataLayer(xml).addTo(map);


leaflet-osm is tested with node.js using mocha and chai:

$ npm install -g mocha
$ npm install
$ mocha


Copyright 2012 John Firebaugh

BSD License (see the BSD-LICENSE file)

Portions derived from OpenLayers. See BSD-LICENSE for details.