From cb980fc85685334ac88d6cc8d2224d219b80006b Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 8 Apr 2014 14:55:41 +0100 Subject: README fixes and updates --- README.md | 23 +++++++++++++++++------ 1 file 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. -- cgit v1.2.3