4
votes

Google Places API for iOS version: 2.2.30010.0

Code:

let filter = GMSAutocompleteFilter()
filter.type = .address
filter.country = "us"
return filter

When searching for example Montrose with filter of type address & country us, the search results display:

enter image description here

The country filter works, but the type filter displays results of type route. Is this the intended behavior?

The Place Autocomplete docs specify:

address instructs the Place Autocomplete service to return only geocoding results with a precise address. Generally, you use this request when you know the user will be looking for a fully specified address.

Maybe I'm misunderstanding what a precise address is, but it seems like the query should only return results with a building number ex. 22 Montrose Ave.

Is it possible to return only places that have building numbers?

1
Were you ever able to find a workaround for this issue? I'm seeing the same behavior using the JavaScript SDK.Sam Hanley
@SamHanley did you find something on this matter?Ahsan Ebrahim
No, I was able to find a couple other mentions of this on the internet, but the closest thing I found to a solution was one blog where the author reimplemented the entire presentation component of the Autocomplete control in ES6, to work around this issue.Sam Hanley
Any solution to this, please?mosses

1 Answers

1
votes

You just need to remove filter.type = .address