如何使用Google自动填充地点api ios获取州特定结果?

时间:2017-07-12 06:51:11

标签: 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
        filter.country = "US"

        autocompleteController.autocompleteFilter = filter

        self.presentViewController(autocompleteController, animated: true, completion: nil)

我想要更多。

1)我想在美国过滤特定的州数据(比如,密歇根州),所以任何想法如何过滤它。我尽力忍受互联网,但我无法得到它。

祝你的回复

1 个答案:

答案 0 :(得分:0)

获取该特定位置的地理位置(在您的情况下为密歇根州)并设置半径并在参数部分中应用strictBounds,它将仅显示该区域内的结果。

相关问题