GoogleNavigation Framework Reference
Stay organized with collections
Save and categorize content based on your preferences.
GMSNavigationRoutingStrategy
enum GMSNavigationRoutingStrategy : NSInteger {}
The routing strategy specifies how routes are ranked, which affects the route when it is chosen
and during re-routing. The default value is GMSNavigationRoutingStrategyDefaultBest
.
-
Ranks routes by NavSDK default cost model. This is the default routing strategy for navigating.
Declaration
Swift
case defaultBest = 0
Objective-C
GMSNavigationRoutingStrategyDefaultBest = 0
-
Ranks routes by distance. The highest ranking route is the shortest of those returned.
Declaration
Objective-C
GMSNavigationRoutingStrategyShorter
-
Ranks routes by absolute delta to a target distance, from smallest to largetest
Declaration
Swift
case deltaToTargetDistance = 2
Objective-C
GMSNavigationRoutingStrategyDeltaToTargetDistance
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\u003eGMSNavigationRoutingStrategy\u003c/code\u003e is an enum used to define how routes are ranked during navigation and re-routing.\u003c/p\u003e\n"],["\u003cp\u003eThe default routing strategy, \u003ccode\u003eGMSNavigationRoutingStrategyDefaultBest\u003c/code\u003e, uses NavSDK's default cost model to rank routes.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGMSNavigationRoutingStrategyShorter\u003c/code\u003e prioritizes the shortest route based on distance.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGMSNavigationRoutingStrategyDeltaToTargetDistance\u003c/code\u003e ranks routes based on their absolute difference from a target distance.\u003c/p\u003e\n"]]],["The `GMSNavigationRoutingStrategy` enum defines how routes are ranked during navigation and re-routing. `GMSNavigationRoutingStrategyDefaultBest` ranks routes using the NavSDK's default cost model and is the default setting. `GMSNavigationRoutingStrategyShorter` prioritizes the shortest route based on distance. `GMSNavigationRoutingStrategyDeltaToTargetDistance` ranks routes by the difference to a target distance, from smallest to largest difference. Each strategy is assigned a unique integer value in both Swift and Objective-C.\n"],null,["# GoogleNavigation Framework Reference\n\nGMSNavigationRoutingStrategy\n============================\n\n enum GMSNavigationRoutingStrategy : NSInteger {}\n\nThe routing strategy specifies how routes are ranked, which affects the route when it is chosen\nand during re-routing. The default value is `GMSNavigationRoutingStrategyDefaultBest`.\n- `\n ``\n ``\n `\n\n ### [GMSNavigationRoutingStrategyDefaultBest](#/c:@E@GMSNavigationRoutingStrategy@GMSNavigationRoutingStrategyDefaultBest)\n\n `\n ` \n Ranks routes by NavSDK default cost model. This is the default routing strategy for navigating. \n\n #### Declaration\n\n Swift \n\n case defaultBest = 0\n\n Objective-C \n\n GMSNavigationRoutingStrategyDefaultBest = 0\n\n- `\n ``\n ``\n `\n\n ### [GMSNavigationRoutingStrategyShorter](#/c:@E@GMSNavigationRoutingStrategy@GMSNavigationRoutingStrategyShorter)\n\n `\n ` \n Ranks routes by distance. The highest ranking route is the shortest of those returned. \n\n #### Declaration\n\n Swift \n\n case shorter = 1\n\n Objective-C \n\n GMSNavigationRoutingStrategyShorter\n\n- `\n ``\n ``\n `\n\n ### [GMSNavigationRoutingStrategyDeltaToTargetDistance](#/c:@E@GMSNavigationRoutingStrategy@GMSNavigationRoutingStrategyDeltaToTargetDistance)\n\n `\n ` \n Ranks routes by absolute delta to a target distance, from smallest to largetest \n\n #### Declaration\n\n Swift \n\n case deltaToTargetDistance = 2\n\n Objective-C \n\n GMSNavigationRoutingStrategyDeltaToTargetDistance"]]