The geodesic distance between the origin and destination. This is the shortest distance between two points on the surface of a sphere (straight-line distance).
// Get routing information for multiple modesRadar.getDistance( origin: origin, destination: destination, modes: [.car, .bike, .foot], units: .imperial) { (status, routes) in if let routes = routes { // Check geodesic distance if let geodesic = routes.geodesic { print("Straight-line distance: \(geodesic.text)") } // Check car route if let car = routes.car { print("Car: \(car.distance.text), \(car.duration.text)") } // Check bike route if let bike = routes.bike { print("Bike: \(bike.distance.text), \(bike.duration.text)") } // Check walking route if let foot = routes.foot { print("Walking: \(foot.distance.text), \(foot.duration.text)") } }}
// Get routing information for multiple modes[Radar getDistanceFromOrigin:origin destination:destination modes:RadarRouteModeCar | RadarRouteModeBike | RadarRouteModeFoot units:RadarRouteUnitsImperial completionHandler:^(RadarStatus status, RadarRoutes * _Nullable routes) { if (routes) { // Check geodesic distance if (routes.geodesic) { NSLog(@"Straight-line distance: %@", routes.geodesic.text); } // Check car route if (routes.car) { NSLog(@"Car: %@, %@", routes.car.distance.text, routes.car.duration.text); } // Check bike route if (routes.bike) { NSLog(@"Bike: %@, %@", routes.bike.distance.text, routes.bike.duration.text); } // Check walking route if (routes.foot) { NSLog(@"Walking: %@, %@", routes.foot.distance.text, routes.foot.duration.text); } }}];