GMSNavigationNavInfo
@interface GMSNavigationNavInfo : NSObject
Contains information about the state of navigation
-
The current
GMSNavigationNavState
for navigation.Declaration
Swift
var navState: GMSNavigationNavState { get }
Objective-C
@property (nonatomic, readonly) GMSNavigationNavState navState;
-
Information about the upcoming maneuver step. This is only set if the navState is
GMSNavigationNavStateEnroute
and will be null otherwise.Declaration
Swift
var currentStep: GMSNavigationStepInfo? { get }
Objective-C
@property (nonatomic, readonly, nullable) GMSNavigationStepInfo *currentStep;
-
The remaining steps after the current step.
Declaration
Swift
var remainingSteps: [GMSNavigationStepInfo] { get }
Objective-C
@property (nonatomic, readonly) NSArray<GMSNavigationStepInfo *> *_Nonnull remainingSteps;
-
Whether the route has changed since the last sent message. A route change may be caused by a reroute, the addition/removal of a waypoint, the user selecting or driving onto an alternate route, or a traffic update.
Declaration
Swift
var routeChanged: Bool { get }
Objective-C
@property (nonatomic, readonly) BOOL routeChanged;
-
The estimated remaining time in seconds along the route to the current step.
Declaration
Swift
var timeToCurrentStepSeconds: TimeInterval { get }
Objective-C
@property (nonatomic, readonly) NSTimeInterval timeToCurrentStepSeconds;
-
The estimated remaining distance in meters along the route to the current step .
Declaration
Swift
var distanceToCurrentStepMeters: CLLocationDistance { get }
Objective-C
@property (nonatomic, readonly) CLLocationDistance distanceToCurrentStepMeters;
-
The estimated remaining time in seconds to the final destination.
Declaration
Swift
var timeToFinalDestinationSeconds: TimeInterval { get }
Objective-C
@property (nonatomic, readonly) NSTimeInterval timeToFinalDestinationSeconds;
-
The estimated remaining distance in meters to the final destination.
Declaration
Swift
var distanceToFinalDestinationMeters: CLLocationDistance { get }
Objective-C
@property (nonatomic, readonly) CLLocationDistance distanceToFinalDestinationMeters;
-
Returns a time rounded to the nearest minute, with a minimum of one minute.
This can be useful when displaying route information to users, since it can be confusing to display times such a “0 min”.
Due to the above, input values to this method should always be positive.
Declaration
Swift
func roundedTime(_ timeSeconds: TimeInterval) -> TimeInterval
Objective-C
- (NSTimeInterval)roundedTime:(NSTimeInterval)timeSeconds;
-
Returns a rounded measurement representing the given distance, taking into account user preferences and the recommended distance unit for the route.
Declaration
Swift
func roundedDistance(_ distanceMeters: CLLocationDistance) -> Measurement<UnitLength>
Objective-C
- (nonnull NSMeasurement<NSUnitLength *> *)roundedDistance: (CLLocationDistance)distanceMeters;
-
The formatted instructions for the given step.
Declaration
Swift
func instructions(forStep stepInfo: GMSNavigationStepInfo, options: GMSNavigationInstructionOptions) -> [NSAttributedString]
Objective-C
- (nonnull NSArray<NSAttributedString *> *) instructionsForStep:(nonnull GMSNavigationStepInfo *)stepInfo options:(nonnull GMSNavigationInstructionOptions *)options;
-
Unavailable
Declaration
Objective-C
- (null_unspecified instancetype)init NS_UNAVAILABLE;