AI-generated Key Takeaways
-
The
GMTSTripobject contains comprehensive logistical data for a trip, including vehicle ID, trip type, pickup/dropoff times and locations, and the route. -
The object provides details about the current trip, such as
tripName,tripType, andtripStatus, allowing for a clear understanding of the journey's state. -
The
GMTSTripobject contains properties relating to trip waypoints such asremainingWaypointsandintermediateDestinations, and can calculateactiveRouteandremainingRoute, showing the path and where the vehicle is. -
The
GMTSTripobject can calculate differences between two given trips using thepropertyValueDifferencesBetweenTrip1:andTrip2:method, comparing each property. -
The object can also be initialized with essential trip details like
tripName,vehicleID,tripType,tripStatus, pickup and dropoff locations and times, and number of passengers.
GMTSTrip
@interface GMTSTrip : GMTCImmutableDataObject that contains logistical information about a trip such as
vehicleId, type of trip, pickup or dropoff times, and route.
-
Name of the trip.
Declaration
Swift
var tripName: String? { get }Objective-C
@property (nonatomic, readonly, nullable) NSString *tripName; -
ID of vehicle servicing the trip.
Declaration
Swift
var vehicleID: String? { get }Objective-C
@property (nonatomic, readonly, nullable) GMTCFleetEngineIDString *vehicleID; -
The current trip type, see
GMTSTripTypefor all the options.Declaration
Swift
var tripType: GMTSTripType { get }Objective-C
@property (nonatomic, readonly) GMTSTripType tripType; -
The current trip status,
GMTSTripStatuslisted for all the possible statuses.Declaration
Swift
var tripStatus: GMTSTripStatus { get }Objective-C
@property (nonatomic, readonly) GMTSTripStatus tripStatus; -
The pickup location of the trip.
Declaration
Swift
var pickupLocation: GMTSTerminalLocation? { get }Objective-C
@property (nonatomic, readonly, nullable) GMTSTerminalLocation *pickupLocation; -
The estimated time of arrival at the pickup location.
Declaration
Swift
var pickupTime: TimeInterval { get }Objective-C
@property (nonatomic, readonly) NSTimeInterval pickupTime; -
The drop off location of the trip.
Declaration
Swift
var dropoffLocation: GMTSTerminalLocation? { get }Objective-C
@property (nonatomic, readonly, nullable) GMTSTerminalLocation *dropoffLocation; -
The estimated time of arrival at the drop off location.
Declaration
Swift
var dropoffTime: TimeInterval { get }Objective-C
@property (nonatomic, readonly) NSTimeInterval dropoffTime; -
The last location information of the vehicle for the trip.
Declaration
Swift
var lastVehicleLocation: GMTSVehicleLocation? { get }Objective-C
@property (nonatomic, readonly, nullable) GMTSVehicleLocation *lastVehicleLocation; -
The number of passengers allowed for the current trip.
Declaration
Swift
var numberOfPassengers: UInt { get }Objective-C
@property (nonatomic, readonly) NSUInteger numberOfPassengers; -
Array of waypoints on the trip route.
Declaration
Swift
var remainingWaypoints: [GMTSTripWaypoint]? { get }Objective-C
@property (nonatomic, readonly, nullable) NSArray<GMTSTripWaypoint *> *remainingWaypoints; -
The array of the consumer’s remaining waypoints.
Declaration
Swift
var intermediateDestinations: [GMTSTerminalLocation]? { get }Objective-C
@property (nonatomic, readonly, nullable) NSArray<GMTSTerminalLocation *> *intermediateDestinations; -
Index of the intermediate waypoint that the vehicle will arrive at next. If there are no intermediate waypoints, this field is ignored.
Declaration
Swift
var intermediateDestinationIndex: Int32 { get }Objective-C
@property (nonatomic, readonly) int32_t intermediateDestinationIndex; -
Returns the tripID for the current trip, converted from tripName.
Declaration
Swift
func tripID() -> String?Objective-C
- (nullable GMTCFleetEngineIDString *)tripID; -
Returns the first waypoint in the remaining waypoints list.
Declaration
Swift
func nextTripWaypoint() -> GMTSTripWaypoint?Objective-C
- (nullable GMTSTripWaypoint *)nextTripWaypoint; -
Returns the next waypoint to be visited. The next waypoint might not belong to this trip if this trip is chained or shared.
Declaration
Swift
func nextWaypoint() -> GMTSTripWaypoint?Objective-C
- (nullable GMTSTripWaypoint *)nextWaypoint; -
Returns the active route of the given trip. This route is from the current location of the vehicle to the current user’s next destination. Unlike the next waypoint in a back-to-back or carpool trip, the next waypoint may not be related to the current user. The return value is generated the first time it is accessed, and then cached.
Declaration
Swift
func activeRoute() -> [GMTSLatLng]?Objective-C
- (nullable NSArray<GMTSLatLng *> *)activeRoute; -
Returns the remaining route of the given trip. The remaining route is the route segment from the current user’s next destination to the user’s final destination.
Declaration
Swift
func remainingRoute() -> [GMTSLatLng]?Objective-C
- (nullable NSArray<GMTSLatLng *> *)remainingRoute; -
Returns the traffic data for the active route of this trip. This route is from the current location of the vehicle to the current user’s next destination. Unlike the next waypoint in a back-to-back or carpool trip, the next waypoint may not be related to the current user. The return value is generated the first time it is accessed, and then cached.
Declaration
Swift
func activeRouteTraffic() -> GMTSTrafficData?Objective-C
- (nullable GMTSTrafficData *)activeRouteTraffic; -
Returns the traffic data for the remaining route of this trip. The remaining route is the route segment from the current user’s next destination to the user’s final destination.
Declaration
Swift
func remainingRouteTraffic() -> GMTSTrafficData?Objective-C
- (nullable GMTSTrafficData *)remainingRouteTraffic; -
Returns the remaining distance of the active route. The active route means the route segment from the vehicle’s location to the current user’s next destination.
Declaration
Swift
func remainingDistanceOfActiveRouteInMeters() -> Int32Objective-C
- (int32_t)remainingDistanceOfActiveRouteInMeters; -
Returns the distance of the remaining route. The remaining route means the route segment from the current user’s next destination to their last destination.
Declaration
Swift
func distanceOfRemainingRouteInMeters() -> Int32Objective-C
- (int32_t)distanceOfRemainingRouteInMeters; -
Calculate the difference between two given trips. Each property difference will be accumulated into the return result.
Declaration
Swift
class func propertyValueDifferencesBetweenTrip1(_ trip1: GMTSTrip, andTrip2 trip2: GMTSTrip) -> GMTSTripPropertyFieldsObjective-C
+ (GMTSTripPropertyFields) propertyValueDifferencesBetweenTrip1:(nonnull GMTSTrip *)trip1 andTrip2:(nonnull GMTSTrip *)trip2;Parameters
trip1The first trip candidate.
trip2The second trip candidate.
-
-initWithTripName:vehicleID:tripType:tripStatus:pickupLocation:pickupTime:dropoffLocation:dropoffTime:lastVehicleLocation:numberOfPassengers:remainingWaypoints:intermediateDestinations:intermediateDestinationIndex:
Instantiates an instance of this class.
Declaration
Swift
init(tripName: String?, vehicleID: String?, tripType: GMTSTripType, tripStatus: GMTSTripStatus, pickupLocation: GMTSTerminalLocation?, pickupTime: TimeInterval, dropoffLocation: GMTSTerminalLocation?, dropoffTime: TimeInterval, last lastVehicleLocation: GMTSVehicleLocation?, numberOfPassengers: UInt, remaining remainingWaypoints: [GMTSTripWaypoint]?, intermediateDestinations: [GMTSTerminalLocation]?, intermediateDestinationIndex: Int32)Objective-C
- (nonnull instancetype) initWithTripName:(nullable NSString *)tripName vehicleID:(nullable GMTCFleetEngineIDString *)vehicleID tripType:(GMTSTripType)tripType tripStatus:(GMTSTripStatus)tripStatus pickupLocation:(nullable GMTSTerminalLocation *)pickupLocation pickupTime:(NSTimeInterval)pickupTime dropoffLocation: (nullable GMTSTerminalLocation *)dropoffLocation dropoffTime:(NSTimeInterval)dropoffTime lastVehicleLocation: (nullable GMTSVehicleLocation *)lastVehicleLocation numberOfPassengers:(NSUInteger)numberOfPassengers remainingWaypoints: (nullable NSArray<GMTSTripWaypoint *> *)remainingWaypoints intermediateDestinations: (nullable NSArray<GMTSTerminalLocation *> *)intermediateDestinations intermediateDestinationIndex:(int32_t)intermediateDestinationIndex;Parameters
tripNameName of the trip.
vehicleIDThe ID of vehicle servicing the trip.
tripTypeTrip type, see enum
GMTSTripTypefor all the options.tripStatusTrip status, see enum
GMTSTripStatusfor all the possible statuses.pickupLocationThe target pickup location.
pickupTimeThe estimated time for arriving at the pickup location.
dropoffLocationThe target drop off location.
dropoffTimeThe estimated time for arriving at the drop off location.
lastVehicleLocationThe last vehicle location information.
numberOfPassengersThe number of passengers allowed in the trip.
remainingWaypointsThe array of waypoints remaining on the trip.
intermediateDestinationsThe array of the consumer’s remaining waypoints.
intermediateDestinationIndexIndex of the intermediate waypoint that the vehicle will arrive at next.
-
Unavailable
Use
-initWithTripName:vehicleID:tripType:tripStatus:pickupLocation:pickupTime:dropoffLocation: dropoffTime:route:lastVehicleLocation:numberOfPassengers:remainingWaypoints: intermediateDestinations:intermediateDestinationIndex:instead.Declaration
Objective-C
- (nonnull instancetype)init;