reverseGeocode

Returns location info for a given latitude-longitude. The result may be a Point of Interest (POI), such as an airport or train station. In this case, the results will also show the details of the POI and any special meeting instructions (such as parking restrictions or Meet and Greet).

reverseGeocode(position: Position) : Call<LocationInfo>

Parameters

Returns

Errors

Examples

iOS

let addressService = Karhoo.getAddressService()

let position = Position(latitude: 42, longitude: 42)

addressService.reverseGeocode(position: position).execute { result in
    switch result {
        case .success(let location):
            print("Location: \(location)")
        case .failure(let error):
            print("error: \(error.code) \(error.message)")
    }
}

Android

val addressService = KarhooApi.addressService
val position = Position(42.0, 42.0)

addressService.reverseGeocode(position).execute { result ->
    when (result) {
        is Resource.Success -> print(result.data)
        is Resource.Failure -> print(result.error.internalMessage)
    }
}