Skip to main content
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:

Initializes a trip leg with a destination geofence identified by tag and external ID.
String
The tag of the destination geofence.
String
The external ID of the destination geofence.

initWithDestinationGeofenceId:

Initializes a trip leg with a destination geofence identified by its Radar ID.
String
required
The Radar ID of the destination geofence.

initWithAddress:

Initializes a trip leg with an address destination.
String
required
The address string for the destination.

initWithCoordinates:

Initializes a trip leg with coordinate-based destination.
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 status
  • RadarTripLegStatusPending - Leg is queued but not yet active
  • RadarTripLegStatusStarted - Device is traveling to this leg’s destination
  • RadarTripLegStatusApproaching - Device is approaching the destination
  • RadarTripLegStatusArrived - Device has arrived at the destination
  • RadarTripLegStatusCompleted - Leg has been completed
  • RadarTripLegStatusCanceled - Leg has been canceled
  • RadarTripLegStatusExpired - 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 type
  • RadarTripLegDestinationTypeGeofence - Destination is a geofence
  • RadarTripLegDestinationTypeAddress - Destination is an address
  • RadarTripLegDestinationTypeCoordinates - 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

Creates a RadarTripLeg from a dictionary representation.
NSDictionary
The dictionary containing leg data.
Returns: A RadarTripLeg instance, or nil if the dictionary is invalid.

legsFromArray

Creates an array of RadarTripLeg objects from an array of dictionaries.
NSArray
The array of dictionaries containing leg data.
Returns: An array of RadarTripLeg instances, or nil if the array is invalid.

arrayForLegs

Converts an array of legs to an array of dictionaries.
NSArray<RadarTripLeg *>
The array of RadarTripLeg instances.
Returns: An array of dictionary representations.

stringForStatus

Returns the string representation of a trip leg status.

statusForString

Returns the trip leg status for a string representation.

stringForDestinationType

Returns the string representation of a trip leg destination type.

destinationTypeForString

Returns the trip leg destination type for a string representation.

Instance Methods

dictionaryValue

Converts the leg to a dictionary representation for API serialization. Returns: A dictionary representation of the leg.

Usage Examples

Creating Trip Legs with Different Destination Types

Creating a Multi-Stop Route

Monitoring Leg Progress

Updating a Trip Leg