RadarTripLeg represents a single destination within a multi-destination trip. Each leg can have its own destination (geofence, address, or coordinates), status, ETA, and metadata. Trip legs allow you to track progress through a route with multiple stops.
Initializers
initWithDestinationGeofenceTag:destinationGeofenceExternalId:
String
The tag of the destination geofence.
String
The external ID of the destination geofence.
initWithDestinationGeofenceId:
String
required
The Radar ID of the destination geofence.
initWithAddress:
String
required
The address string for the destination.
initWithCoordinates:
CLLocationCoordinate2D
required
The coordinates for the destination (latitude and longitude).
Response Properties
These properties are populated from server responses and are read-only.String
The Radar ID of the leg. Set from server response. Use this ID when calling
updateTripLeg or completeTripLeg.RadarTripLegStatus
The status of the leg. Set from server response.Values:
RadarTripLegStatusUnknown- Unknown statusRadarTripLegStatusPending- Leg is queued but not yet activeRadarTripLegStatusStarted- Device is traveling to this leg’s destinationRadarTripLegStatusApproaching- Device is approaching the destinationRadarTripLegStatusArrived- Device has arrived at the destinationRadarTripLegStatusCompleted- Leg has been completedRadarTripLegStatusCanceled- Leg has been canceledRadarTripLegStatusExpired- Leg has expired
RadarTripLegDestinationType
The destination type for this leg. When parsed from a server response, reflects the server’s
destination.type. Otherwise, inferred from which properties are set (geofence > address > coordinates).Values:RadarTripLegDestinationTypeUnknown- Unknown destination typeRadarTripLegDestinationTypeGeofence- Destination is a geofenceRadarTripLegDestinationTypeAddress- Destination is an addressRadarTripLegDestinationTypeCoordinates- Destination is a coordinate pair
NSDate
The date when the leg was created. Set from server response.
NSDate
The date when the leg was last updated. Set from server response.
float
The ETA duration in minutes to this leg’s destination. Set from server response.
float
The ETA distance in meters to this leg’s destination. Set from server response.
Geofence Destination Properties
String
The tag of the destination geofence for this leg. Use with
destinationGeofenceExternalId for geofence-based destinations.String
The external ID of the destination geofence for this leg. Use with
destinationGeofenceTag for geofence-based destinations.String
The Radar ID of the destination geofence for this leg. Alternative to using
destinationGeofenceTag + destinationGeofenceExternalId.Address Destination Properties
String
The address string for the destination of this leg. Use for address-based destinations.
Coordinate Destination Properties
CLLocationCoordinate2D
The coordinates for the destination of this leg. Use for coordinate-based destinations. Set latitude and longitude.
BOOL
Whether coordinates have been explicitly set and are valid.
NSInteger
The arrival radius in meters for coordinate-based destinations. Only used when coordinates are set. Defines how close the device needs to be to the coordinates to be considered arrived.
Common Properties
NSInteger
The stop duration in minutes for this leg. Indicates how long the device should remain at this destination before moving to the next leg.
NSDictionary
An optional set of custom key-value pairs for this leg. Use this to attach any custom data to the leg.
Class Methods
legFromDictionary
RadarTripLeg from a dictionary representation.
NSDictionary
The dictionary containing leg data.
RadarTripLeg instance, or nil if the dictionary is invalid.
legsFromArray
RadarTripLeg objects from an array of dictionaries.
NSArray
The array of dictionaries containing leg data.
RadarTripLeg instances, or nil if the array is invalid.
arrayForLegs
NSArray<RadarTripLeg *>
The array of
RadarTripLeg instances.stringForStatus
statusForString
stringForDestinationType
destinationTypeForString
Instance Methods
dictionaryValue
Usage Examples
Creating Trip Legs with Different Destination Types
Creating a Multi-Stop Route
Monitoring Leg Progress
Updating a Trip Leg
Related
- RadarTripOptions - Configure trips with multiple legs
- RadarTrip - The parent trip object containing legs
- Trip Tracking Guide - Complete guide to trip tracking