AI-generated Key Takeaways
-
GMSNavigationMutableRoutingOptions
allows customization of route calculation logic, such as prioritizing routes by time or distance using theroutingStrategy
property. -
It enables control over alternate route generation with the
alternateRoutesStrategy
property. -
Developers can specify target distances for route ranking using the
targetDistancesMeters
property, primarily for the initial destination. -
This mutable class inherits from
GMSNavigationRoutingOptions
and provides flexibility in defining navigation behavior.
GMSNavigationMutableRoutingOptions
@interface GMSNavigationMutableRoutingOptions : GMSNavigationRoutingOptions
A 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
GMSNavigationAlternateRoutesStrategy
and 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;