aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2014-04-08 14:55:41 +0100
committerChristopher Baines <mail@cbaines.net>2014-04-08 14:55:41 +0100
commitcb980fc85685334ac88d6cc8d2224d219b80006b (patch)
tree33941dfbcc838eacb6d3262c15d67044b8f09c89
parentd0b2941199d7bdc02fd5588a2396e8b204227e87 (diff)
downloadleaflet-indoor-cb980fc85685334ac88d6cc8d2224d219b80006b.tar
leaflet-indoor-cb980fc85685334ac88d6cc8d2224d219b80006b.tar.gz
README fixes and updates
-rw-r--r--README.md23
1 files changed, 17 insertions, 6 deletions
diff --git a/README.md b/README.md
index 006f05c..c19e8f1 100644
--- a/README.md
+++ b/README.md
@@ -11,19 +11,30 @@ You can see the demo included in the example directory
## Using the plugin
-See the included examples for usage.
+See the included example for usage.
### Basic Usage
-Create a L.IndoorLayer, then add the data to it.
+Create a L.Indoor, then add the data to it.
```javascript
-var indoorLayer = new L.IndoorLayer();
+// where data is a GeoJSON feature collection
+var indoorLayer = new L.Indoor(data);
-var levelControl = new L.Control.Level()
+// set the initial level to show
+indoorLayer.setLevel("0");
+
+indoorLayer.addTo(map);
+
+var levelControl = new L.Control.Level({
+ level: "0",
+ levels: indoorLayer.getLevels()
+});
// Connect the level control to the indoor layer
levelControl.addEventListener("levelchange", indoorLayer.setLevel, indoorLayer);
+
+levelControl.addTo(map);
```
## Events
@@ -32,5 +43,5 @@ L.Control.Level will fire levelchange events when a level is selected.
## License
-Leaflet Indoor is free software, and may be redistributed under the
-MIT-LICENSE.
+Leaflet Indoor is free software, and may be redistributed under the BSD
+2-Clause License.