GoogleNavigation Framework Reference

  • GMSNavigationSpeedAlertOptions is an immutable class used to define triggering thresholds for different severities of speed alerts.

  • It allows customization of speed alert thresholds as percentages for both minor and major alerts.

  • The severityUpgradeDurationSeconds property controls the time duration before a minor alert escalates to a major alert.

  • You can retrieve the threshold percentage for a specific GMSNavigationSpeedAlertSeverity using the thresholdPercentage(for:) or thresholdPercentageForSpeedAlertSeverity: method.

  • Speed alerts triggered by these thresholds can have their UI customized using GMSNavigationSpeedometerUIOptions.

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;