GoogleNavigation Framework Reference

GMSNavigationMutableSpeedAlertOptions

@interface GMSNavigationMutableSpeedAlertOptions
    : GMSNavigationSpeedAlertOptions

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

  • 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. This duration threshold is used only if the minor threshold percentage is set. A negative value indicates no duration threshold.

    Declaration

    Swift

    var severityUpgradeDurationSeconds: TimeInterval { get set }

    Objective-C

    @property (nonatomic) NSTimeInterval severityUpgradeDurationSeconds;
  • Sets the speed alert threshold in percentage for the specific GMSNavigationSpeedAlertSeverity. One severity of speed alert is triggered when the speed exceeds the corresponding threshold.

    If both minor and major speed alert threshold are set, the major speed alert threshold must be smaller than the major one. If only one speed alert severity’s threshold is set, the other severity of speed alert will not be triggered.

    If you set the minor threshold to a value larger than the major threshold, the options updates the major threshold to equal the minor threshold. And vice versa.

    Declaration

    Swift

    func setSpeedAlertThresholdPercentage(_ percentageAboveLimit: CGFloat, for speedAlertSeverity: GMSNavigationSpeedAlertSeverity)

    Objective-C

    - (void)setSpeedAlertThresholdPercentage:(CGFloat)percentageAboveLimit
                       forSpeedAlertSeverity:
                           (GMSNavigationSpeedAlertSeverity)speedAlertSeverity;

    Parameters

    percentageAboveLimit

    Percentage threshold above the speed limit. A value of 0.0 represents 0%, and 1.0 represents 100%. A negative value indicates no threshold being set for that speedingType.

    speedAlertSeverity

    Speed alert severity for the given threshold.