如何从GMSGeocoder reverseGeocodeCoordinate以零响应

时间:2016-04-03 10:50:59

标签: ios swift google-maps google-maps-sdk-ios reverse-geocoding

在我的iOS应用中,我想让用户在GMSMapView上用长按手势选择一个地址。所以我实现了mapView:_ didLongPressAtCoordinate:_方法来获取他选择的坐标并进行reverseGeocoding并得到地址:

    let geocoder = GMSGeocoder()

    geocoder.reverseGeocodeCoordinate(coordinate) { response, error in
        if let address = response?.firstResult() {
            // Everything ok
        } else {
            // Here the response is 'nil'
        }
    }

如果响应为nil以获取与人类可读地址最近的位置坐标,我可以在此处执行哪些操作?

0 个答案:

没有答案