shmidt / GooglePlacesSearchController

Google Places autocompleting address search controller
MIT License
194 stars 44 forks source link

Add filter in GooglePlacesSearchController #28

Closed Pairroxz closed 4 years ago

Pairroxz commented 4 years ago

How can I add a search Filter like this

 // Specify a filter.
        let filter = GMSAutocompleteFilter()
        filter.type = .address
        filter.country = "IN"
        autocompleteController.autocompleteFilter = filter

in GooglePlacesSearchController Please suggest?

shashi751 commented 4 years ago

I fix this issue In GooglePlacesSearchController after line number 305 add below code and it will work as search parameters["components"] = "country:in"

In place of "in" parameter you can put your country and search fix to that specific country. You can add up to 5 country there by using below code For example: parameters ["components"]="country:us"|"country:pr"|"country:vi"|"country:gu"|"country:mp"