GMSNavigationRoutingOptions Class Reference

GMSNavigationRoutingOptions Class Reference

Overview

An immutable class that contains options related to routing logic (e.g., routing strategy).

Inherited by GMSNavigationMutableRoutingOptions.

Public Member Functions

(instancetype) - initWithRoutingStrategy:
 Initializes the routing options with routing strategy.
(instancetype) - initWithAlternateRoutesStrategy:
 Initializes the routing options with an alternate routes strategy.
(instancetype) - initWithTargetDistancesMeters:
 Initializes the routing options with target distances, and sets the routing strategy to GMSNavigationRoutingStrategyDeltaToTargetDistance.

Properties

GMSNavigationRoutingStrategy routingStrategy
 Specifies the ranking order of routes, either by time, or by distance.
GMSNavigationAlternateRoutesStrategy alternateRoutesStrategy
 The alternate routes strategy used when setting destinations.
NSArray< NSNumber * > * targetDistancesMeters
 An array of target distances.

Member Function Documentation

- (instancetype) initWithRoutingStrategy: (GMSNavigationRoutingStrategy routingStrategy

Initializes the routing options with routing strategy.

Parameters:
routingStrategyRouting strategy that specifies the order of returned routes.
- (instancetype) initWithAlternateRoutesStrategy: (GMSNavigationAlternateRoutesStrategy alternateRoutesStrategy

Initializes the routing options with an alternate routes strategy.

Parameters:
alternateRoutesStrategyAlternate routes strategy that determines the number of returned alternate routes.
- (instancetype) initWithTargetDistancesMeters: (NSArray< NSNumber * > *)  targetDistancesMeters

Initializes the routing options with target distances, and sets the routing strategy to GMSNavigationRoutingStrategyDeltaToTargetDistance.

Ensure that target distances are always up-to-date when used.

Parameters:
targetDistancesMetersTarget distances for destinations. Each target distance is used to rank the routes to its corresponding destination by its absolute delta to the routes.

Property Documentation

Specifies the ranking order of routes, either by time, or by distance.

Implemented in GMSNavigationMutableRoutingOptions.

The alternate routes strategy used when setting destinations.

Implemented in GMSNavigationMutableRoutingOptions.

- (NSArray<NSNumber *>*) targetDistancesMeters [read, assign]

An array of target distances.

An target distance is used to rank routes to a destination by the absolute delta to it from smallest to largest. 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.

Implemented in GMSNavigationMutableRoutingOptions.