CostModel

public struct CostModel

Criteria that specify what paths to prefer during routing.

Important

This is a Public Preview API. It may be changed or removed at any time.

Lifecycle

  • Declaration

    Swift

    public init
        (
            routeType: RouteType = .fast,
            considerTraffic: ConsiderTraffic? = .yes,
            avoidOptions: AvoidOptions? = nil
        )

    Parameters

    routeType

    The overall path preference.

    considerTraffic

    Specifies whether current traffic should be considered when planning the route.

    avoidOptions

    What to avoid.

Public

  • The overall path preference.

    Declaration

    Swift

    public let routeType: RouteType
  • Specifies whether current traffic should be considered when planning the route.

    Declaration

    Swift

    public let considerTraffic: ConsiderTraffic?
  • avoidOptions What to avoid.

    Declaration

    Swift

    public let avoidOptions: AvoidOptions?

CostModel

  • Copies the current CostModel with changes specified in build closure

    Declaration

    Swift

    public func copy(build: (inout Builder) -> ()) -> CostModel

    Parameters

    build

    This closure allows for change of CostModel values

    Return Value

    CostModel with the changes set on the closure

  • The Builder creates a new instance of CostModel with modified fields.

    Declaration

    Swift

    public struct Builder