Skip to content

Commit

Permalink
Bumped version and updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-ward committed Aug 31, 2016
1 parent 8758f11 commit 4681782
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 10 deletions.
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,21 +69,33 @@ map.addControl(control);


## Events


### Search Event
This control fires a `search` event with the value of search parameters:

```
> control.on('search', function(e){console.log(e.params)});
`control.on('search', function(e){console.log(e.params)});`

=> {q: "oregon", lang: "en"}
```
results in
`{q: "oregon", lang: "en"}`


### Select Event
This control fires a `select` event when an option was selected from list,
with the full response JSON from geonames:

`control.on('select', function(e){console.log(e.geoname)});`

results in
`{adminCode1: "OR", lng: "-120.50139", geonameId: 5744337, ...}`


## Demos:
- [Basic](http://consbio.github.io/Leaflet.Geonames/examples/basic.html)
- [Admin Codes](http://consbio.github.io/Leaflet.Geonames/examples/adminCodes.html)
- [Bounding Box](http://consbio.github.io/Leaflet.Geonames/examples/bbox.html)
- [Locale](http://consbio.github.io/Leaflet.Geonames/examples/locale.html)
- [Events](http://consbio.github.io/Leaflet.Geonames/examples/events.html)


## Credits:
Expand All @@ -93,5 +105,6 @@ Some ideas derived from [L.GeoSearch](https://github.com/smeijer/L.GeoSearch).

## Contributors:
* [Brendan Ward](https://github.com/brendan-ward)
* [Kaveh Karimi-Asli](https://github.com/ka7eh)
* [Kaveh Karimi-Asli](https://github.com/ka7eh)
* [Nik Molnar](https://github.com/nikmolnar)
* [Mike Moran](https://github.com/mikemoraned)
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Leaflet.Geonames",
"version": "0.2.1",
"version": "0.3.0",
"homepage": "https://github.com/consbio/Leaflet.Geonames",
"authors": [
"Brendan Ward <[email protected]>"
Expand Down
1 change: 1 addition & 0 deletions examples/adminCodes.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ <h2 style="float:left;margin:0;">Admin Codes Example: <small>Only placenames in
<li><a href="basic.html">Basic</a></li>
<li><a href="bbox.html">Bounding Box</a></li>
<li><a href="locale.html">Locale</a></li>
<li><a href="events.html">Events</a></li>
</ul>
</div>
<div id="map" style="position: absolute; top: 3em; left:0; bottom:0; right: 0;border-top:2px solid #555;"></div>
Expand Down
1 change: 1 addition & 0 deletions examples/basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ <h2 style="float:left;margin:0;">Basic Geonames Example</h2>
<li><a href="adminCodes.html">Admin Codes</a></li>
<li><a href="bbox.html">Bounding Box</a></li>
<li><a href="locale.html">Locale</a></li>
<li><a href="events.html">Events</a></li>
</ul>
</div>
<div id="map" style="position: absolute; top: 3em; left:0; bottom:0; right: 0;border-top:2px solid #555;"></div>
Expand Down
1 change: 1 addition & 0 deletions examples/bbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ <h2 style="float:left;margin:0;">Bounding Box Example: <small>only placenames in
<li><a href="basic.html">Basic</a></li>
<li><a href="adminCodes.html">Admin Codes</a></li>
<li><a href="locale.html">Locale</a></li>
<li><a href="events.html">Events</a></li>
</ul>
</div>
<div id="map" style="position: absolute; top: 3em; left:0; bottom:0; right: 0;border-top:2px solid #555;"></div>
Expand Down
10 changes: 7 additions & 3 deletions examples/events.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script src="//cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.0-rc.3/leaflet.js"></script>
<script src="../L.Control.Geonames.js"></script>
<div>
<h2 style="float:left;margin:0;">Event Handling Example</h2>
<h2 style="float:left;margin:0;">Event Handling Example: <small>See event data in your javascript console</small></h2>
<ul id="Nav" style="float:right;list-style-type:none; margin:0;padding:0;">
<li><b>Other examples:</b></li>
<li><a href="basic.html">Basic</a></li>
Expand All @@ -37,10 +37,14 @@ <h2 style="float:left;margin:0;">Event Handling Example</h2>
minZoom: 2
}).addTo(map);

var control = L.control.geonames({username: 'cbi.test', showPoint: false, showPopup: false});
var control = L.control.geonames({username: 'cbi.test'});

control.on('select', function(e){
control.on('search', function(e){
console.log('GeoNames search: ', e.params);
});

control.on('select', function(e){
console.log('GeoName selected: ', e.geoname);
});

map.addControl(control);
Expand Down
1 change: 1 addition & 0 deletions examples/locale.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ <h2 style="float:left;margin:0;">Locale Example: <small>placenames are returned
<li><a href="basic.html">Basic</a></li>
<li><a href="adminCodes.html">Admin Codes</a></li>
<li><a href="bbox.html">Bounding Box</a></li>
<li><a href="events.html">Events</a></li>
</ul>
</div>
<div id="map" style="position: absolute; top: 3em; left:0; bottom:0; right: 0;border-top:2px solid #555;"></div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "leaflet-geonames",
"version": "0.2.1",
"version": "0.3.0",
"description": "Geonames Geocoding Search Control for Leaflet",
"homepage": "http://github.com/consbio/Leaflet.Geonames",
"author": {
Expand Down

0 comments on commit 4681782

Please sign in to comment.