diff options
author | Christopher Baines <mail@cbaines.net> | 2014-04-08 14:55:41 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2014-04-08 14:55:41 +0100 |
commit | cb980fc85685334ac88d6cc8d2224d219b80006b (patch) | |
tree | 33941dfbcc838eacb6d3262c15d67044b8f09c89 | |
parent | d0b2941199d7bdc02fd5588a2396e8b204227e87 (diff) | |
download | leaflet-indoor-cb980fc85685334ac88d6cc8d2224d219b80006b.tar leaflet-indoor-cb980fc85685334ac88d6cc8d2224d219b80006b.tar.gz |
README fixes and updates
-rw-r--r-- | README.md | 23 |
1 files changed, 17 insertions, 6 deletions
@@ -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. |