如何使用Google autocomplete place api ios获得特定于州的结果?
我使用下面的代码来过滤国家数据,我获得了成功。我正在Xcode 8.0中开发Swift 2.3如何使用Google autocomplete place api ios获得特定于州的结果?,ios,swift,google-maps,filter,google-places-api,Ios,Swift,Google Maps,Filter,Google Places Api,我使用下面的代码来过滤国家数据,我获得了成功。我正在Xcode 8.0中开发Swift 2.3 let autocompleteController = GMSAutocompleteViewController() autocompleteController.delegate = self let filter = GMSAutocompleteFilter() filter.type = .Address f
let autocompleteController = GMSAutocompleteViewController()
autocompleteController.delegate = self
let filter = GMSAutocompleteFilter()
filter.type = .Address
filter.country = "US"
autocompleteController.autocompleteFilter = filter
self.presentViewController(autocompleteController, animated: true, completion: nil)
我想要更多
1) 我想过滤美国特定的州数据(比如密歇根州),所以我想知道如何过滤它。我在最好的状态下上网,但我无法上网
希望您的回复获取该特定位置的地理位置(在您的案例中为密歇根州)在参数部分设置半径并应用strictBounds,它将只显示该区域内的结果。但当该区域内没有结果时,它将显示其他结果。.如果您完全想要限制,则必须提供这些参数。我在“didAutocompleteWith place:GMSPlace”中更改了代码我将“field.name”与州“MI”或“Michigan”(字符串)进行比较。如果它匹配的话,那就更进一步。嗨,你找到解决这个问题的办法了吗?因为我必须做同样的事情。谢谢