google's getPlacePredictions doesn't cope with options as illustrated in the props doc
See original GitHub issueIn the documentation, you suggest
const options = {
location: new google.maps.LatLng(-34, 151),
radius: 2000,
types: ['address']
}
<PlacesAutocomplete
inputProps={inputProps}
options={options}
/>
but this leads getPlacePredictions to return INVALID_REQUEST
as documentation shows that the call should have an prod field and an options prop.
This was working before but I guess google’s api is more strict now. I was able to overcome the problem by now defining
const options = {
options: {
location: new google.maps.LatLng(-34, 151),
radius: 2000,
types: ['address']
}
}
but I guess PlacesAutocomplete.js#L67 might just need to be options: this.props.options
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
Google AutocompleteService getPlacePredictions is not working
Afterwards I tried multiple options: At first I tried with simple Autocomplete request to see any result. I entered the following code: let ......
Read more >Place Autocomplete | Maps JavaScript API - Google Developers
SearchBox offers fewer options than Autocomplete for restricting the search. ... Call getPlacePredictions() to retrieve matching places, ...
Read more >Integrating Google Places Autocomplete API in a React App
The AutocompleteService class doesn't provide any UI component. Still, it allows you to get place predictions data programmatically and display ...
Read more >ErrorPro/react-google-autocomplete - GitHub
Is a hook that has a single config argument. It has exactly the same interface as ReactGoogleAutocomplete props. This hook is actually used...
Read more >Google Maps JavaScript API Tutorial - YouTube
In this video I will work a little bit with the Google Maps API as requested by some of my subscribers. We will...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m gonna get to the bottom of this…
@diligiant Thank you for taking a look at this 👍