AI-generated Key Takeaways
-
GMSNavigationMutableSpeedAlertOptions
defines thresholds for triggering speed alerts of varying severity (minor/major). -
You can customize thresholds as percentages above the speed limit for each alert severity.
-
A major speed alert is triggered if the speed exceeds the minor threshold for a specified duration, controlled by
severityUpgradeDurationSeconds
. -
Setting a threshold for one severity (minor/major) while leaving the other unset will prevent alerts of the unset severity from triggering.
-
If minor and major thresholds are set, the major threshold must be lower than the minor threshold; the system automatically adjusts them to ensure this.
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.