Documentation Index
Fetch the complete documentation index at: https://mintlify.com/radarlabs/radar-sdk-ios/llms.txt
Use this file to discover all available pages before exploring further.
RadarRoute represents a route between an origin and a destination, including distance, duration, and geometry information.
Properties
distance
RadarRouteDistance
required
The distance of the route.
The distance in feet (for imperial units) or meters (for metric units).
A display string for the distance.
duration
RadarRouteDuration
required
The duration of the route.
A display string for the duration.
geometry
RadarRouteGeometry
required
The geometry of the route.
The geometry of the route as an array of coordinates.Each RadarCoordinate contains a CLLocationCoordinate2D coordinate property.
Instance Methods
dictionaryValue
func dictionaryValue() -> [String: Any]
- (NSDictionary *_Nonnull)dictionaryValue;
Converts the route to a dictionary representation.
Returns
A dictionary representation of the route.
Example
// Get routing information
Radar.getDistance(
origin: origin,
destination: destination,
modes: [.car],
units: .imperial
) { (status, routes) in
if let route = routes?.car {
print("Distance: \(route.distance.text)")
print("Duration: \(route.duration.text)")
if let coordinates = route.geometry.coordinates {
print("Route has \(coordinates.count) points")
}
}
}
// Get routing information
[Radar getDistanceFromOrigin:origin
destination:destination
modes:RadarRouteModeCar
units:RadarRouteUnitsImperial
completionHandler:^(RadarStatus status, RadarRoutes * _Nullable routes) {
RadarRoute *route = routes.car;
if (route) {
NSLog(@"Distance: %@", route.distance.text);
NSLog(@"Duration: %@", route.duration.text);
if (route.geometry.coordinates) {
NSLog(@"Route has %lu points", (unsigned long)route.geometry.coordinates.count);
}
}
}];
See Also