Skip to content

Commit

Permalink
closes #9, finishes 0.4.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
brendan-ward committed Jun 1, 2017
1 parent 841493b commit 6c02ad5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
## Version 0.4.0 (DATE TODO)
## Version 0.4.0 (5/31/2017)
* converted input field to a search field type
* added examples/mobileview.html example for mobile ready version
* added option `alwaysOpen` to keep search field always visible
* exposed `show()`, `hide()`, `hideResults()` `removeMarker()`, `removePopup()` functions
* updated event handling to prevent click events from propagating to map
* changed default icon from directions type icon to magnifying glass icon
* added `topcenter` as a position for the control with autosizing to mobile viewports
* clicking on the icon no longer clears out the marker; clearing the search field does so instead
* clicking on the icon no longer clears out the marker; clearing the search field does so instead
* added ability to override Geonames URL
3 changes: 2 additions & 1 deletion L.Control.Geonames.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ L.Control.Geonames = L.Control.extend({
_hasResults: false,
options: {
//position: 'topcenter', // in addition to standard 4 corner Leaflet control layout, this will position and size from top center
geonamesURL: '//api.geonames.org/searchJSON', // override this if using a proxy to get connection to geonames
username: '', //Geonames account username. Must be provided
maxresults: 5, //Maximum number of results to display per search
zoomLevel: null, //Max zoom level to zoom to for location. If null, will use the map's max zoom level.
Expand Down Expand Up @@ -219,7 +220,7 @@ L.Control.Geonames = L.Control.extend({
style: "LONG"
};

var url = '//api.geonames.org/searchJSON?' + this._objToQuery(coreParams) + '&' + this._objToQuery(searchParams);
var url = this.options.geonamesURL + '?' + this._objToQuery(coreParams) + '&' + this._objToQuery(searchParams);
if (this.options.featureClasses && this.options.featureClasses.length){
url += '&' + this.options.featureClasses.map(function(fc){return 'featureClass=' + fc}).join('&');
}
Expand Down
2 changes: 1 addition & 1 deletion L.Control.Geonames.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Example usage:
```
var control = L.control.geonames({
//position: 'topcenter', // in addition to standard 4 corner Leaflet control layout, this will position and size from top center
geonamesURL: '//api.geonames.org/searchJSON', // override this if using a proxy to get connection to geonames
username: '', // Geonames account username. Must be provided
zoomLevel: null, // Max zoom level to zoom to for location. If null, will use the map's max zoom level.
maxresults: 5, // Maximum number of results to display per search
Expand Down

0 comments on commit 6c02ad5

Please sign in to comment.