RouteOptions

public struct RouteOptions

Class that contains configuration of the route that will be drawn on the map.

Example:

let routeOption: RouteOptions = RouteOptions(coordinates: route.geometry)
guard let mapRoute = try? self.mapView.map.addRoute(routeOption) else { return }
  • Initialization of the route object. Creates route regular route segment type that contains all provided coordinates.

    Declaration

    Swift

    public init(coordinates: [CLLocationCoordinate2D])

    Parameters

    coordinates

    Array of coordinates.

  • Initialization of the route object. Creates route regular route segment type that contains all provided coordinates.

    Important

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

    Declaration

    Swift

    public init(coordinates: [CLLocationCoordinate2D], sections: [RouteSection])
  • Initialization of the polyline object.

    Declaration

    Swift

    public init(polyline: String)

    Parameters

    polyline

    String object containing an encoded polyline.

  • The width of the route tube in dps units for all scene levels. This will only affect the width of the route if the widthToZoomMap is empty. If routeWidth is not explicitly set, then the default value 3 will be used. The routeWidth should not be negative, the minimum value is 1.

    Declaration

    Swift

    public var routeWidth: Double
  • Route tube width for the given zoom level. When settings this to an empty Dictionary, routeWidth will decide the width of the route for all scene levels. If widthToZoomMap is not explicitly set, then the default value [6: 6, 13: 10, 15: 12, 18: 13, 19: 14] will be used.

    Declaration

    Swift

    public var widthToZoomMap: [Double : Double]
  • Icon showing the beginning of the route.

    Declaration

    Swift

    public var departureMarkerImage: UIImage?
  • Icon showing the end of the route.

    Declaration

    Swift

    public var destinationMarkerImage: UIImage?
  • Texture of anchor lines of the route. Anchor lines can be for example destination or departure lines.

    Declaration

    Swift

    public var anchorLineImage: UIImage?
  • Color of the displayed route. If color is not explicitly set, then the default value UIColor(red: 0.25, green: 0.61, blue: 0.85, alpha: 1.00) will be used.

    Declaration

    Swift

    public var color: UIColor
  • Color of any unreachable parts of the displayed route.

    Declaration

    Swift

    public var unreachableColor: UIColor?
  • The outline width in dps units of the route tube for all scene levels. If outlineWidth is not explicitly set, then the default value 1.5 will be used. The outlineWidth should not be negative, the minimum value is 0. For most zoom levels, the recommended value for the outlineWidth is half the routeWidth.

    Declaration

    Swift

    public var outlineWidth: Double
  • Icon to use for route waypoints.

    Declaration

    Swift

    public var waypointMarker: UIImage?
  • Array of the coordinates of any waypoints along the route. If waypoints is not explicitly set, then the default value of an empty Array will be used.

    Declaration

    Swift

    public var waypoints: [CLLocationCoordinate2D]
  • Flag checking if route is followable. Set to false by default.

    Declaration

    Swift

    public var isFollowable: Bool
  • Reachable distance.

    Declaration

    Swift

    public var reachableDistance: Measurement<UnitLength>?
  • Instructions that needed for complex camera behaviour. If instructions is not explicitly set, then the default value of an empty Array will be used.

    Declaration

    Swift

    public var instructions: [RouteInstruction]
  • Destination coordinate of the route. If no destination is explicitly set, this contains the last element in the coordinate array.

    Declaration

    Swift

    public var destination: CLLocationCoordinate2D?
  • Departure coordinate of the route. If no departure is explicitly set, this contains the first element in the coordinate array.

    Declaration

    Swift

    public var departure: CLLocationCoordinate2D? { get }