google-maps-services-js icon indicating copy to clipboard operation
google-maps-services-js copied to clipboard

`autocomplete`: add support for `locationbias` and `locationrestriction` parameters

Open saeltz opened this issue 2 years ago • 3 comments

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.

saeltz avatar Jul 21 '23 06:07 saeltz

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:

This is an automated message, feel free to ignore.

wangela avatar Jul 21 '23 06:07 wangela

Would love this feature as well! Might add that the locationRestriction parameter would also be very valuable here.

ChloeConstantineau avatar Jul 21 '23 07:07 ChloeConstantineau

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)

usefulthink avatar Oct 10 '23 11:10 usefulthink