Permalink
Browse files

Update README

  • Loading branch information...
1 parent 742b9a6 commit 38665cc6c02bf020922cb166a6f2eb6ab2884301 @jfirebaugh committed Oct 19, 2012
Showing with 12 additions and 3 deletions.
  1. +12 −3 README.md
View
@@ -1,19 +1,28 @@
leaflet-osm is a [Leaflet](http://leaflet.cloudmade.com/) plugin for rendering
-vector data from openstreetmap.org.
+tile and vector data from openstreetmap.org.
For example, the openstreetmap.org website could use it to highlight a particular
[way](http://www.openstreetmap.org/?way=52477381) or [node](http://www.openstreetmap.org/?node=164979149)
on the base map.
-## Usage Example
+## 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(xml).addTo(map);
+ var layer = new L.OSM.DataLayer(xml).addTo(map);
map.fitBounds(layer.getBounds());
}
});

0 comments on commit 38665cc

Please sign in to comment.