如何从PlaceID或GMSPlace获取GMSAddress [英] How to get GMSAddress from PlaceID or GMSPlace
问题描述
我使用iOS版Google Places API的自动填充功能,并返回placeID。我如何从placeID获取GMSAddress?我目前使用lookupPlaceID来获得GMSPlace,然后使用reverseGeocodeCoordinate从GMSPlace中的坐标中获取GMSAddress。但它要求Google API 3次:AutoComplete,lookupPlaceID,reverseGeocodeCoordinate。
有没有办法直接从PlaceID或GMSPlace获取GMSAddress?
这是Google Maps SDK for iOS 1.1.0的一个bug。请参阅此处。
正如文档所述此处< 地址
属性应该在 GMSPlace $ c $>上显示
GMSAddress
c>实例。
我刚刚切换到使用REST API。为API编写快速封装并完全抛弃Google SDK也不错。如果您使用Alamofire ping我,我可以分享我写的内容。
I am using Autocomplete of Google Places API for iOS, and it returns placeID. How can I get GMSAddress from the placeID? I currently use lookupPlaceID to get GMSPlace, and then use reverseGeocodeCoordinate to get GMSAddress from coordinate in GMSPlace. But it request Google API 3 times: AutoComplete, lookupPlaceID, reverseGeocodeCoordinate.
Is there any way to get GMSAddress from PlaceID or GMSPlace directly?
This is a bug with 1.1.0 of the Google Maps SDK for iOS. See here.
As the documentation states here, the address
property should expose a GMSAddress
on GMSPlace
instances.
I've just switched to using the REST API. It's not too bad to write a quick wrapper for the API and ditch the Google SDK completely. If you are using Alamofire ping me and I may be able to share what I've written.
这篇关于如何从PlaceID或GMSPlace获取GMSAddress的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!