google-maps-services-js
google-maps-services-js copied to clipboard
`autocomplete`: add support for `locationbias` and `locationrestriction` parameters
Is your feature request related to a problem? Please describe.
Imagine having a rectangle for which you want to use placeAutocomplete to autocomplete places. Currently, only using the epicentre and radius is supported. This yields to many irrelevant autocompletions outside of the rectangle.
Describe the solution you'd like
The Google Maps SDK for Place Autocomplete supports setBounds with a southwest and northeast coordinate, see the documentation. It'd be awesome for this library to support that as well.
Describe alternatives you've considered Now we're using the alternative with radius and filtering afterwards if an autocompletion is within our rectangle. That is an inefficient solution, both looking at requests, API costs and code.
Additional context We'd be willing to support on the implementation when given some guidance.
If you would like to upvote the priority of this issue, please comment below or react with :+1: so we can see what is popular when we triage.
@saeltz Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:
- Check the issue tracker - bugs and feature requests for Google Maps Platform APIs and SDKs
- Open a support case - Get 1:1 support in Cloud Console.
- Discord - chat with other developers
- StackOverflow - use the
google-mapstag
This is an automated message, feel free to ignore.
Would love this feature as well!
Might add that the locationRestriction parameter would also be very valuable here.
As you already mentioned, the only supported options right now are radius and location. But there are the locationbias and locationrestriction parameters available that this library doesn't support at the moment that would cover your use-case. (see https://developers.google.com/maps/documentation/places/web-service/autocomplete?hl=en)