-
Notifications
You must be signed in to change notification settings - Fork 637
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Places: Allow multiple country:XX in component param #128
Comments
I agree, this would be very useful. Also would like to know if there's a way to sort suggestions or assign priority? Or an open feature request where we can vote on? In my use case it would be useful to have suggestions first grouped/filtered by a certain country and only then list suggestions for all countries (without the country limitation) as there is this open issue. |
Note that the current documentation is wrong. It's written that Cf https://googlemaps.github.io/google-maps-services-js/docs/GoogleMapsClient.html |
I am able to filter by one country only in
Filtering by multiple countries as mentioned in the docs would be great but not essential for me right now. I may pull-request a fix if I get some time... |
Okay after digging into the code there seems to be a bug with how it is building the query. According to the docs the string produced needs to be in the form I was able to get multiple countries working with the following
Which produces the query
|
I switched the pipedKeyValues for this:
And it worked. It's not very efficient but it's okay. I also haven't tested to see if it screws with anything else. |
This is resolved in #192 |
Is this on the road map to be published to the npm package: @google/maps ? |
1 similar comment
Is this on the road map to be published to the npm package: @google/maps ? |
This is wrong. https://developers.google.com/maps/documentation/geocoding/intro#ComponentFiltering |
@eveevans Ye, I know it's an AND query. My comment was more a means of getting it to work |
According to the docs, we're suppose to be able to filter search results to up to 5 countries by adding multiple piped
country:xx
, ascomponents=country:us|country:pr|country:vi|country:gu|country:mp
.However, this is not possible when current param type is an object, as
component:{country:'us'}
.I've tried different ways with string, arrays etc with no luck.
Suggestion:
Accept object OR string as
component
param.The text was updated successfully, but these errors were encountered: