GoogleNavigation Framework Reference

GMSNavigationSpeedAlertOptions

@interface GMSNavigationSpeedAlertOptions
    : NSObject <NSCopying, NSMutableCopying>

An immutable class that defines triggering thresholds for different severities of speed alerts, represented by GMSNavigationSpeedAlertSeverity.

You can use this to customize the speed alert triggering thresholds in percentage for both minor and major alerts, and customize the time based triggering threshold for major speed alert.

The speed alerts triggered by corresponding thresholds from this GMSNavigationSpeedAlertOptions have UI customized in GMSNavigationSpeedometerUIOptions if set.

  • The duration threshold controls the speed alert severity upgrade. A major speed alert is triggered when the speed exceeds the minor speed alert threshold for more than the given number of seconds.

    Declaration

    Swift

    var severityUpgradeDurationSeconds: TimeInterval { get }

    Objective-C

    @property (nonatomic, readonly) NSTimeInterval severityUpgradeDurationSeconds;
  • Gets the speed alert threshold (as a percentage) for the specific GMSNavigationSpeedAlertSeverity. A value of 0.0 represents 0%, and 1.0 represents 100%. A negative value indicates no threshold being set for that speedingType.

    Declaration

    Swift

    func thresholdPercentage(for speedAlertSeverity: GMSNavigationSpeedAlertSeverity) -> CGFloat

    Objective-C

    - (CGFloat)thresholdPercentageForSpeedAlertSeverity:
        (GMSNavigationSpeedAlertSeverity)speedAlertSeverity;