GoogleRidesharingConsumer Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMTSVehicleLocation
Object that contains the location information for the vehicle that describes
the heading, speed, and time when this information was retrieved.
-
Declaration
Objective-C
@property (nonatomic, readonly, nullable) GMTSLatLng *latLng;
-
The radius of uncertainty for latLng
, measured in meters. The
latLng
indicates the center of the circle, and latLngAccuracy
indicates the
radius of that circle.
Declaration
Swift
var latLngAccuracy: Double { get }
Objective-C
@property (nonatomic, readonly) double latLngAccuracy;
-
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. The heading
identifies 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;
-
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;
-
Deprecated
Use -initWithOptions
instead.
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
latLng
|
The location of the vehicle.
|
latLngAccuracy
|
The location accuracy of the vehicle.
|
heading
|
The heading corner radius of the vehicle.
|
headingAccuracy
|
The heading accuracy of the vehicle.
|
speed
|
The speed of the vehicle.
|
speedAccuracy
|
The speed accuracy of the vehicle.
|
updateTime
|
The timestamp of the update time.
|
isSnappableToRoute
|
Indicates whether the vehicle can be snapped to the route.
|
-
Designated initialization.
Parameters
options
|
The options for the vehicle location.
|
-
Use initWithOptions:
instead.
Declaration
Objective-C
- (nonnull instancetype)init;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003eGMTSVehicleLocation provides comprehensive location data for a vehicle, including its latitude and longitude (\u003ccode\u003elatLng\u003c/code\u003e), along with the accuracy of that location (\u003ccode\u003elatLngAccuracy\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe object also details the vehicle's movement characteristics, such as its heading direction (\u003ccode\u003eheading\u003c/code\u003e), heading accuracy (\u003ccode\u003eheadingAccuracy\u003c/code\u003e), speed (\u003ccode\u003espeed\u003c/code\u003e), and speed accuracy (\u003ccode\u003espeedAccuracy\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eIt records the time when the vehicle's location data was last updated (\u003ccode\u003eupdateTime\u003c/code\u003e) and when Fleet Engine received the location update from the Driver app (\u003ccode\u003eupdateServerTime\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eThe GMTSVehicleLocation class allows developers to determine if a vehicle's position can be snapped to a route (\u003ccode\u003eisSnappableToRoute\u003c/code\u003e) and provides two methods of initialization for getting started.\u003c/p\u003e\n"]]],[],null,["# GoogleRidesharingConsumer Framework Reference\n\nGMTSVehicleLocation\n===================\n\n @interface GMTSVehicleLocation : ../Classes/GMTCImmutableData.html\n\nObject that contains the location information for the vehicle that describes\nthe heading, speed, and time when this information was retrieved.\n- `\n ``\n ``\n `\n\n ### [latLng](#/c:objc(cs)GMTSVehicleLocation(py)latLng)\n\n `\n ` \n Location of the vehicle. \n\n #### Declaration\n\n Swift \n\n var latLng: ../Classes/GMTSLatLng.html? { get }\n\n Objective-C \n\n @property (nonatomic, readonly, nullable) ../Classes/GMTSLatLng.html *latLng;\n\n- `\n ``\n ``\n `\n\n ### [latLngAccuracy](#/c:objc(cs)GMTSVehicleLocation(py)latLngAccuracy)\n\n `\n ` \n The radius of uncertainty for [latLng](../Classes/GMTSVehicleLocation.html#/c:objc(cs)GMTSVehicleLocation(py)latLng), measured in meters. The\n [latLng](../Classes/GMTSVehicleLocation.html#/c:objc(cs)GMTSVehicleLocation(py)latLng) indicates the center of the circle, and `latLngAccuracy` indicates the\n radius of that circle. \n\n #### Declaration\n\n Swift \n\n var latLngAccuracy: Double { get }\n\n Objective-C \n\n @property (nonatomic, readonly) double latLngAccuracy;\n\n- `\n ``\n ``\n `\n\n ### [heading](#/c:objc(cs)GMTSVehicleLocation(py)heading)\n\n `\n ` \n Heading corner radius of the vehicle. \n\n #### Declaration\n\n Swift \n\n var heading: CLLocationDirection { get }\n\n Objective-C \n\n @property (nonatomic, readonly) CLLocationDirection heading;\n\n- `\n ``\n ``\n `\n\n ### [headingAccuracy](#/c:objc(cs)GMTSVehicleLocation(py)headingAccuracy)\n\n `\n ` \n The radius of uncertainty for [heading](../Classes/GMTSVehicleLocation.html#/c:objc(cs)GMTSVehicleLocation(py)heading), measured in degrees. The [heading](../Classes/GMTSVehicleLocation.html#/c:objc(cs)GMTSVehicleLocation(py)heading)\n identifies the mean of the heading estimate and this value indicates the\n standard deviation of the estimate. \n\n #### Declaration\n\n Swift \n\n var headingAccuracy: Double { get }\n\n Objective-C \n\n @property (nonatomic, readonly) double headingAccuracy;\n\n- `\n ``\n ``\n `\n\n ### [speed](#/c:objc(cs)GMTSVehicleLocation(py)speed)\n\n `\n ` \n Speed of the vehicle. \n\n #### Declaration\n\n Swift \n\n var speed: Int32 { get }\n\n Objective-C \n\n @property (nonatomic, readonly) int32_t speed;\n\n- `\n ``\n ``\n `\n\n ### [speedAccuracy](#/c:objc(cs)GMTSVehicleLocation(py)speedAccuracy)\n\n `\n ` \n Accuracy of speed in meters per second. \n\n #### Declaration\n\n Swift \n\n var speedAccuracy: Double { get }\n\n Objective-C \n\n @property (nonatomic, readonly) double speedAccuracy;\n\n- `\n ``\n ``\n `\n\n ### [updateTime](#/c:objc(cs)GMTSVehicleLocation(py)updateTime)\n\n `\n ` \n The timestamp of the update time. \n\n #### Declaration\n\n Swift \n\n var updateTime: TimeInterval { get }\n\n Objective-C \n\n @property (nonatomic, readonly) NSTimeInterval updateTime;\n\n- `\n ``\n ``\n `\n\n ### [isSnappableToRoute](#/c:objc(cs)GMTSVehicleLocation(py)isSnappableToRoute)\n\n `\n ` \n Indicates whether the vehicle can be snapped to the route. \n\n #### Declaration\n\n Swift \n\n var isSnappableToRoute: Bool { get }\n\n Objective-C \n\n @property (nonatomic, readonly) BOOL isSnappableToRoute;\n\n- `\n ``\n ``\n `\n\n ### [updateServerTime](#/c:objc(cs)GMTSVehicleLocation(py)updateServerTime)\n\n `\n ` \n The timestamp in milliseconds when Fleet Engine received the updated location from the Driver\n app. You can use this to determine if the \"Driver\" is \"Connected\". By comparing this timestamp\n with the current time in the device, you can determine how long ago the driver location was\n reported to Fleet Engine. A negative value indicates that this value is not valid (it is absent). \n\n #### Declaration\n\n Swift \n\n var updateServerTime: TimeInterval { get }\n\n Objective-C \n\n @property (nonatomic, readonly) NSTimeInterval updateServerTime;\n\n- `\n ``\n ``\n `\n\n ### [-initWithLatLng:latLngAccuracy:heading:headingAccuracy:speed:speedAccuracy:updateTime:isSnappableToRoute:](#/c:objc(cs)GMTSVehicleLocation(im)initWithLatLng:latLngAccuracy:heading:headingAccuracy:speed:speedAccuracy:updateTime:isSnappableToRoute:)\n\n `\n ` \n Deprecated\n\n Use `-initWithOptions` instead. \n Designated initialization. \n\n #### Declaration\n\n Swift \n\n convenience init(latLng: ../Classes/GMTSLatLng.html?, latLngAccuracy: Double, heading: CLLocationDirection, headingAccuracy: Double, speed: Int32, speedAccuracy: Double, updateTime: TimeInterval, isSnappableToRoute: Bool)\n\n Objective-C \n\n - (nonnull instancetype)initWithLatLng:(nullable ../Classes/GMTSLatLng.html *)latLng\n latLngAccuracy:(double)latLngAccuracy\n heading:(CLLocationDirection)heading\n headingAccuracy:(double)headingAccuracy\n speed:(int32_t)speed\n speedAccuracy:(double)speedAccuracy\n updateTime:(NSTimeInterval)updateTime\n isSnappableToRoute:(BOOL)isSnappableToRoute;\n\n #### Parameters\n\n |----------------------------|------------------------------------------------------------|\n | ` `*latLng*` ` | The location of the vehicle. |\n | ` `*latLngAccuracy*` ` | The location accuracy of the vehicle. |\n | ` `*heading*` ` | The heading corner radius of the vehicle. |\n | ` `*headingAccuracy*` ` | The heading accuracy of the vehicle. |\n | ` `*speed*` ` | The speed of the vehicle. |\n | ` `*speedAccuracy*` ` | The speed accuracy of the vehicle. |\n | ` `*updateTime*` ` | The timestamp of the update time. |\n | ` `*isSnappableToRoute*` ` | Indicates whether the vehicle can be snapped to the route. |\n\n- `\n ``\n ``\n `\n\n ### [-initWithOptions:](#/c:objc(cs)GMTSVehicleLocation(im)initWithOptions:)\n\n `\n ` \n Designated initialization. \n\n #### Declaration\n\n Swift \n\n init(options: ../Classes/GMTSVehicleLocationOptions.html)\n\n Objective-C \n\n - (nonnull instancetype)initWithOptions:\n (nonnull ../Classes/GMTSVehicleLocationOptions.html *)options;\n\n #### Parameters\n\n |-----------------|---------------------------------------|\n | ` `*options*` ` | The options for the vehicle location. |\n\n- `\n ``\n ``\n `\n\n ### [-init](#/c:objc(cs)GMTSVehicleLocation(im)init)\n\n `\n ` \n Unavailable \n Use `initWithOptions:` instead. \n\n #### Declaration\n\n Objective-C \n\n - (nonnull instancetype)init;"]]