react-geosuggest
Advanced tools
Comparing version 1.5.0 to 1.6.0
@@ -0,1 +1,9 @@ | ||
## 1.6.0 (2015-08-12) | ||
#### Features | ||
* **input:** add bounds, country and types params ([00a84866](https://github.com/ubilabs/react-geosuggest/commit/00a84866d109ce4e323705558ffe319d56ecd5b1), closes [#20](https://github.com/ubilabs/react-geosuggest/issues/20)) | ||
## 1.5.0 (2015-08-12) | ||
@@ -2,0 +10,0 @@ |
@@ -26,2 +26,5 @@ /* global google */ | ||
radius: 0, | ||
bounds: null, | ||
country: null, | ||
types: null, | ||
googleMaps: google && google.maps, | ||
@@ -77,7 +80,23 @@ onFocus: noop, | ||
this.state.autocompleteService.getPlacePredictions({ | ||
var options = { | ||
input: this.state.userInput, | ||
location: this.props.location || new this.props.googleMaps.LatLng(0, 0), | ||
radius: this.props.radius | ||
}, (function (suggestsGoogle) { | ||
}; | ||
if (this.props.bounds) { | ||
options.bounds = this.props.bounds; | ||
} | ||
if (this.props.types) { | ||
options.types = this.props.types; | ||
} | ||
if (this.props.country) { | ||
options.componentRestrictions = { | ||
country: this.props.country | ||
}; | ||
} | ||
this.state.autocompleteService.getPlacePredictions(options, (function (suggestsGoogle) { | ||
this.updateSuggests(suggestsGoogle); | ||
@@ -84,0 +103,0 @@ }).bind(this)); |
{ | ||
"name": "react-geosuggest", | ||
"version": "1.5.0", | ||
"version": "1.6.0", | ||
"description": "A React autosuggest for the Google Maps Places API.", | ||
@@ -5,0 +5,0 @@ "main": "module/Geosuggest.js", |
@@ -78,4 +78,22 @@ # React Geosuggest | ||
The radius defines the area around the locaiton to use for biasing the suggests. It must be accompanied by a `location` parameter. | ||
The radius defines the area around the location to use for biasing the suggests. It must be accompanied by a `location` parameter. | ||
#### bounds | ||
Type: [`LatLngBounds`](https://developers.google.com/maps/documentation/javascript/reference?csw=1#LatLngBounds) | ||
Default: `null` | ||
The bounds to use for biasing the suggests. If this is set, `location` and `radius` are ignored. | ||
#### country | ||
Type: `String` | ||
Default: `null` | ||
Restricts predictions to the specified country (ISO 3166-1 Alpha-2 country code, case insensitive). E.g., us, br, au. | ||
#### types | ||
Type: `Array` | ||
Default: `null` | ||
Restricts the suggestions against the passed in types. If none are specified, all types are used. Consult the Google Docs for [possible types](https://developers.google.com/places/supported_types). | ||
#### fixtures | ||
@@ -82,0 +100,0 @@ Type: `Array` |
25918
329
229