如何使用Google自动填充位置api ios sdk获取特定国家/地区的结果? [英] How to get country specific result with Google autocomplete place api ios sdk?
问题描述
- (void)autocompleteQuery:使用下面的方法获取GMSPlacesClient类的输入字符串的自动完成结果: (GMSAutocompleteFilter * GMS_NULLABLE_PTR)过滤器
回调函数:(GMSAutocompletePredictionsCallback)回调函数
$ / code $($)
bounds:(GMSCoordinateBounds * GMS_NULLABLE_PTR)bounds
filter:(GMSAutocompleteFilter * GMS_NULLABLE_PTR)
我尝试通过多种方式实现边界,但它们都没有工作,我想知道是否有任何标准方法可以通过GMSCoordinateBounds获得特定于国家/地区的结果?
您可以使用Google自动填充位置api iOS SDK获取特定国家/地区的结果。只需转至此链接
let filter = GMSAutocompleteFilter()
filter.type = .Establishment
filter.country =UK
将过滤器国家设置为所需的国家/地区代码。然后,您只能获取特定国家/地区的结果。
您可以从链接
希望这有帮助。
I'm using below method to get autocomplete result for input string of GMSPlacesClient class:
- (void)autocompleteQuery:(NSString *)query
bounds:(GMSCoordinateBounds * GMS_NULLABLE_PTR)bounds
filter:(GMSAutocompleteFilter * GMS_NULLABLE_PTR)filter
callback:(GMSAutocompletePredictionsCallback)callback
I tried to implement bounds by multiple ways but none of them worked, I wonder if there is any standard way to get country specific results with GMSCoordinateBounds?
You can get the country specific results with the Google autocomplete place api iOS SDK. Just go to this link
let filter = GMSAutocompleteFilter()
filter.type = .Establishment
filter.country = "UK"
set the filter country to what ever the country code you want. This will then fetch only country specific results for you.
You can obtain the country codes from this link
Hope this helps.
这篇关于如何使用Google自动填充位置api ios sdk获取特定国家/地区的结果?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!