Google Maps iOS Reverse Geocoding

后端 未结 3 1842
耶瑟儿~
耶瑟儿~ 2021-02-09 18:40

I am having an issue with Google Maps Reverse Geocoding when it comes to setting a UILabel\'s text to the reverse geocoded address. The UILabel is in an XIB use as a custom info

3条回答
  •  佛祖请我去吃肉
    2021-02-09 18:49

    The first response worked for me. As an alternative to

    marker.title = lines.joined(separator: "\n")`
    

    try this, it will give you the street address:

    marker.title = response?.firstResult()?.thoroughfare
    marker.snippet = response?.firstResult()?.locality
    

    For the city, try

    marker.snippet = response?.firstResult()?.locality
    

提交回复
热议问题