aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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.