TransitRouteOptions

public struct TransitRouteOptions : Hashable

All the options to specify how a public transit route should be calculated.

  • Optional time when travel is expected to start. If it is not specified, it is set to the current time.

    Declaration

    Swift

    public var departureTime: Date?
  • Optional time when travel is expected to end.

    Declaration

    Swift

    public var arrivalTime: Date?
  • Number of alternative routes to return aside from the optimal route. The provided value must be in the range [0, 6]. By default, it is 0 and only one route is calculated.

    Declaration

    Swift

    public var alternatives: Int32
  • Maximum number of changes or transfers allowed in a route. When it is not set, unlimited number of changes is permitted. The provided value must be in the range [0, 6].

    Declaration

    Swift

    public var changes: Int32?
  • Defines inclusion or exclusion of transit modes for route calculation. By default, the inclusion mode is used.

    Declaration

    Swift

    public var modeFilter: TransitModeFilter
  • This list is used to determine which transit modes should be used for route calculation, TransitRouteOptions.modeFilter specifies whether this list is an inclusion or an exclusion. For example, specifying subway and bus transit modes with the include filter, returns only subway and bus transit modes, and with the exclude filter, returns all the transit modes except subway and bus. When not set, all the supported transit modes are permitted. By default, this list is empty.

    Declaration

    Swift

    public var modes: [TransitMode]
  • Walking speed in meters per second. Influences the duration of walking segments from origin to a station, from a station to destination and in-between the stations (e.g. if transfer is needed). The provided value must be in the range [0.5, 2.0]. The default value is 1.0 mps.

    Declaration

    Swift

    public var pedestrianSpeedInMetersPerSecond: Double
  • Maximum allowed walking distance in meters (e.g. when looking for nearest stations). The provided value must be in the range [0, 6000]. The default value is 2000 meters.

    Declaration

    Swift

    public var pedestrianMaxDistanceInMeters: Int32
  • Customize textual content returned from the route calculation, such as localization, format, and unit system.

    Declaration

    Swift

    public var textOptions: RouteTextOptions
  • Creates a new instance.

    Declaration

    Swift

    public init(departureTime: Date? = nil, arrivalTime: Date? = nil, alternatives: Int32 = 0, changes: Int32? = nil, modeFilter: TransitModeFilter = TransitModeFilter.include, modes: [TransitMode] = [], pedestrianSpeedInMetersPerSecond: Double = 1.0, pedestrianMaxDistanceInMeters: Int32 = 2000, textOptions: RouteTextOptions = RouteTextOptions())
  • Returns TransitRouteOptions instance with default values used in SDK.

    Declaration

    Swift

    public static func fromDefaultParameterConfiguration() -> TransitRouteOptions

    Return Value

    An TransitRouteOptions instance with default values used in SDK.