AI-generated Key Takeaways
-
GMTSVehicleLocation provides comprehensive location data for a vehicle, including its latitude and longitude (
latLng), along with the accuracy of that location (latLngAccuracy). -
The object also details the vehicle's movement characteristics, such as its heading direction (
heading), heading accuracy (headingAccuracy), speed (speed), and speed accuracy (speedAccuracy). -
It records the time when the vehicle's location data was last updated (
updateTime) and when Fleet Engine received the location update from the Driver app (updateServerTime). -
The GMTSVehicleLocation class allows developers to determine if a vehicle's position can be snapped to a route (
isSnappableToRoute) and provides two methods of initialization for getting started.
GMTSVehicleLocation
@interface GMTSVehicleLocation : GMTCImmutableDataObject that contains the location information for the vehicle that describes the heading, speed, and time when this information was retrieved.
-
Location of the vehicle.
Declaration
Swift
var latLng: GMTSLatLng? { get }Objective-C
@property (nonatomic, readonly, nullable) GMTSLatLng *latLng; -
Heading corner radius of the vehicle.
Declaration
Swift
var heading: CLLocationDirection { get }Objective-C
@property (nonatomic, readonly) CLLocationDirection heading; -
The radius of uncertainty for
heading, measured in degrees. Theheadingidentifies the mean of the heading estimate and this value indicates the standard deviation of the estimate.Declaration
Swift
var headingAccuracy: Double { get }Objective-C
@property (nonatomic, readonly) double headingAccuracy; -
Speed of the vehicle.
Declaration
Swift
var speed: Int32 { get }Objective-C
@property (nonatomic, readonly) int32_t speed; -
Accuracy of speed in meters per second.
Declaration
Swift
var speedAccuracy: Double { get }Objective-C
@property (nonatomic, readonly) double speedAccuracy; -
The timestamp of the update time.
Declaration
Swift
var updateTime: TimeInterval { get }Objective-C
@property (nonatomic, readonly) NSTimeInterval updateTime; -
Indicates whether the vehicle can be snapped to the route.
Declaration
Swift
var isSnappableToRoute: Bool { get }Objective-C
@property (nonatomic, readonly) BOOL isSnappableToRoute; -
The timestamp in milliseconds when Fleet Engine received the updated location from the Driver app. You can use this to determine if the “Driver” is “Connected”. By comparing this timestamp with the current time in the device, you can determine how long ago the driver location was reported to Fleet Engine. A negative value indicates that this value is not valid (it is absent).
Declaration
Swift
var updateServerTime: TimeInterval { get }Objective-C
@property (nonatomic, readonly) NSTimeInterval updateServerTime; -
-initWithLatLng:latLngAccuracy:heading:headingAccuracy:speed:speedAccuracy:updateTime:isSnappableToRoute:
Deprecated
Use
-initWithOptionsinstead.Designated initialization.
Declaration
Swift
convenience init(latLng: GMTSLatLng?, latLngAccuracy: Double, heading: CLLocationDirection, headingAccuracy: Double, speed: Int32, speedAccuracy: Double, updateTime: TimeInterval, isSnappableToRoute: Bool)Objective-C
- (nonnull instancetype)initWithLatLng:(nullable GMTSLatLng *)latLng latLngAccuracy:(double)latLngAccuracy heading:(CLLocationDirection)heading headingAccuracy:(double)headingAccuracy speed:(int32_t)speed speedAccuracy:(double)speedAccuracy updateTime:(NSTimeInterval)updateTime isSnappableToRoute:(BOOL)isSnappableToRoute;Parameters
latLngThe location of the vehicle.
latLngAccuracyThe location accuracy of the vehicle.
headingThe heading corner radius of the vehicle.
headingAccuracyThe heading accuracy of the vehicle.
speedThe speed of the vehicle.
speedAccuracyThe speed accuracy of the vehicle.
updateTimeThe timestamp of the update time.
isSnappableToRouteIndicates whether the vehicle can be snapped to the route.
-
Designated initialization.
Declaration
Swift
init(options: GMTSVehicleLocationOptions)Objective-C
- (nonnull instancetype)initWithOptions: (nonnull GMTSVehicleLocationOptions *)options;Parameters
optionsThe options for the vehicle location.
-
Unavailable
Use
initWithOptions:instead.Declaration
Objective-C
- (nonnull instancetype)init;