GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSNavigationMutableSpeedAlertOptions
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
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-27 UTC.
[null,null,["Last updated 2025-08-27 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSNavigationMutableSpeedAlertOptions\u003c/code\u003e defines thresholds for triggering speed alerts of varying severity (minor/major).\u003c/p\u003e\n"],["\u003cp\u003eYou can customize thresholds as percentages above the speed limit for each alert severity.\u003c/p\u003e\n"],["\u003cp\u003eA major speed alert is triggered if the speed exceeds the minor threshold for a specified duration, controlled by \u003ccode\u003eseverityUpgradeDurationSeconds\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eSetting a threshold for one severity (minor/major) while leaving the other unset will prevent alerts of the unset severity from triggering.\u003c/p\u003e\n"],["\u003cp\u003eIf minor and major thresholds are set, the major threshold must be lower than the minor threshold; the system automatically adjusts them to ensure this.\u003c/p\u003e\n"]]],["`GMSNavigationMutableSpeedAlertOptions` defines speed alert thresholds. `severityUpgradeDurationSeconds` sets the time needed to upgrade to a major alert after exceeding the minor threshold. `setSpeedAlertThresholdPercentage` configures percentage-based thresholds for specific `GMSNavigationSpeedAlertSeverity` levels. A major alert threshold must be smaller than a minor one; if one is set higher, the other updates to match. Negative values indicate no threshold or duration.\n"],null,["# GoogleNavigation Framework Reference\n\nGMSNavigationMutableSpeedAlertOptions\n=====================================\n\n @interface GMSNavigationMutableSpeedAlertOptions\n : ../Classes/GMSNavigationSpeedAlertOptions.html\n\nA mutable class that defines triggering thresholds for different severities of speed alerts,\nrepresented by [GMSNavigationSpeedAlertSeverity](../Enums/GMSNavigationSpeedAlertSeverity.html).\n- `\n ``\n ``\n `\n\n ### [severityUpgradeDurationSeconds](#/c:objc(cs)GMSNavigationMutableSpeedAlertOptions(py)severityUpgradeDurationSeconds)\n\n `\n ` \n The duration threshold controls the speed alert severity upgrade. A major speed alert is\n triggered when the speed exceeds the minor speed alert threshold for more than the given number\n of seconds. This duration threshold is used only if the minor threshold percentage is set. A\n negative value indicates no duration threshold. \n\n #### Declaration\n\n Swift \n\n var severityUpgradeDurationSeconds: TimeInterval { get set }\n\n Objective-C \n\n @property (nonatomic) NSTimeInterval severityUpgradeDurationSeconds;\n\n- `\n ``\n ``\n `\n\n ### [-setSpeedAlertThresholdPercentage:forSpeedAlertSeverity:](#/c:objc(cs)GMSNavigationMutableSpeedAlertOptions(im)setSpeedAlertThresholdPercentage:forSpeedAlertSeverity:)\n\n `\n ` \n Sets the speed alert threshold in percentage for the specific [GMSNavigationSpeedAlertSeverity](../Enums/GMSNavigationSpeedAlertSeverity.html).\n One severity of speed alert is triggered when the speed exceeds the corresponding threshold.\n\n If both minor and major speed alert threshold are set, the major speed alert threshold must be\n smaller than the major one. If only one speed alert severity's threshold is set, the other\n severity of speed alert will not be triggered.\n\n If you set the minor threshold to a value larger than the major threshold, the options updates\n the major threshold to equal the minor threshold. And vice versa. \n\n #### Declaration\n\n Swift \n\n func setSpeedAlertThresholdPercentage(_ percentageAboveLimit: CGFloat, for speedAlertSeverity: ../Enums/GMSNavigationSpeedAlertSeverity.html)\n\n Objective-C \n\n - (void)setSpeedAlertThresholdPercentage:(CGFloat)percentageAboveLimit\n forSpeedAlertSeverity:\n (../Enums/GMSNavigationSpeedAlertSeverity.html)speedAlertSeverity;\n\n #### Parameters\n\n |------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n | ` `*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. |\n | ` `*speedAlertSeverity*` ` | Speed alert severity for the given threshold. |"]]