Reputation: 125
let filter = GMSAutocompleteFilter()
filter.type = GMSPlacesAutocompleteTypeFilter.city
filter.country = "USA" || "CA"
how to get 2 country results in google autocomplete
Upvotes: 2
Views: 2459
Reputation: 31
It's possible to do using following syntax
filter.country = "CA|country:US"
reference link here.
Upvotes: 1
Reputation: 1
It's currently not possible. I would recommend using the web API, where you can send up to 5 ISO country codes in your query (see components under "optional parameters":
https://developers.google.com/places/web-service/autocomplete
Upvotes: 0
Reputation: 27448
If you check country property in GMSAutocompleteFilter
class then you will found that it is string
so I think you can't set multiple country in your filter. If it's allowing multiple country then it should be array
or any collection
instead of string! and in documentation also they haven't mentioned for multiple countries in filter! So, I think you can't set more than one country at a time in one filter!
Upvotes: 2