AI-generated Key Takeaways
-
GMSNavigationMutableRoutingOptionsallows customization of route calculation logic, such as prioritizing routes by time or distance using theroutingStrategyproperty. -
It enables control over alternate route generation with the
alternateRoutesStrategyproperty. -
Developers can specify target distances for route ranking using the
targetDistancesMetersproperty, primarily for the initial destination. -
This mutable class inherits from
GMSNavigationRoutingOptionsand provides flexibility in defining navigation behavior.
GMSNavigationMutableRoutingOptions
@interface GMSNavigationMutableRoutingOptions : GMSNavigationRoutingOptionsA mutable class that contains options related to routing logic (e.g., routing strategy).
-
Specifies the ranking order of routes, either by time, or by distance.
Declaration
Swift
var routingStrategy: GMSNavigationRoutingStrategy { get set }Objective-C
@property (nonatomic) GMSNavigationRoutingStrategy routingStrategy; -
The alternate routes strategy used when setting destinations.
Declaration
Swift
var alternateRoutesStrategy: GMSNavigationAlternateRoutesStrategy { get set }Objective-C
@property (nonatomic) GMSNavigationAlternateRoutesStrategy alternateRoutesStrategy; -
Target distances used to ranking the routes. The elements should be non-negative integers. Don’t set
GMSNavigationAlternateRoutesStrategyand this field at the same time. Target distance is only supported for the first destination for now. So only put one positive integer in the array. If the first element is not a positive integer, the routing strategy defaults to the best routing strategy.Declaration
Swift
var targetDistancesMeters: [NSNumber]? { get set }Objective-C
@property (nonatomic, copy, nullable) NSArray<NSNumber *> *targetDistancesMeters;