Skip to content

Commit

Permalink
Update event binding examples in README
Browse files Browse the repository at this point in the history
  • Loading branch information
jfirebaugh committed Oct 27, 2012
1 parent e473af7 commit dcfe306
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions README.md
Expand Up @@ -13,19 +13,24 @@ You may <a href="http://tripbirds.com/hotels/new-york/?bounds=40.721,-73.992,40.
Create a new LocationFilter and add it to the map:

```javascript
var locationFilter = new L.LocationFilter({
onChange: function(bounds) {
// do something with the the filter bounds
},

onEnabled: function(bounds) {
// do something with the the filter bounds
},

onDisabled: function(bounds) {
// do something with the the filter bounds
}
}).addTo(map);
var locationFilter = new L.LocationFilter().addTo(map);
```

Bind some events:

```javascript
locationFilter.on("change", function (e) {
// Do something when the bounds change.
// Bounds are available in `e.bounds`.
});

locationFilter.on("enabled", function () {
// Do something when enabled.
});

locationFilter.on("disabled", function () {
// Do something when disabled.
});
```

Get the current bounds:
Expand Down

0 comments on commit dcfe306

Please sign in to comment.