leaflet-osm

0.1.0 • Public • Published

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

For example, the openstreetmap.org 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);
// or L.OSM.CycleMap, L.OSM.TransportMap, or L.OSM.MapQuestOpen

Data Layer

$.ajax({
  url: "http://www.openstreetmap.org/api/0.6/node/164979149",
  // or "http://www.openstreetmap.org/api/0.6/way/52477381/full"
  dataType: "xml",
  success: function (xml) {
    var layer = new L.OSM.DataLayer(xml).addTo(map);
    map.fitBounds(layer.getBounds());
  }
});

Contributing

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

$ npm install -g mocha
$ npm install
$ mocha

License

Copyright 2012 John Firebaugh

BSD License (see the BSD-LICENSE file)

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

Readme

Keywords

none

Package Sidebar

Install

npm i leaflet-osm

Weekly Downloads

13

Version

0.1.0

License

none

Last publish

Collaborators

  • jfirebaugh