SPRouteStep

@interface SPRouteStep : NSObject

Object containing information for a section/step on the route. A route consists of multiple logical ‘steps’ where actions may need to be taken or instructions may need to be shown. Generally the SDK will internally generate these steps and SPRouteStep objects should be considered ‘read-only’.

Disclaimer: a route step has nothing to do with physical steps taken.

  • Recommended initializer for SPRouteStep objects

    Declaration

    Objective-C

    - (nonnull instancetype)
        initWithCoordinates:(nonnull NSArray<NSArray<NSNumber *> *> *)coordinates
                   distance:(CGFloat)distance
               instructions:(nonnull NSDictionary *)instructions;

    Swift

    init(coordinates: [[NSNumber]], distance: CGFloat, instructions: [AnyHashable : Any])

    Parameters

    coordinates

    contains coordinate points in the following format: [ [lat, lon, floor], …]

    distance

    distance for step in meters

    instructions

    used to generate turn by turn instructions

    Return Value

    new instance of SPRouteStep

  • Declaration

    Objective-C

    - (nonnull NSArray<NSArray<NSNumber *> *> *)coordinates;

    Swift

    func coordinates() -> [[NSNumber]]

    Return Value

    list containings coordinates for this step in format: [ [lat, lon, floor], …]

  • Declaration

    Objective-C

    - (SPRouteAction)action;

    Swift

    func action() -> SPRouteAction

    Return Value

    action type for route step

  • Declaration

    Objective-C

    - (nonnull NSString *)instructions;

    Swift

    func instructions() -> String

    Return Value

    instructions for route step will use the total distance for the step

  • Declaration

    Objective-C

    - (nonnull NSString *)instructionsWith:(CGFloat)distance;

    Swift

    func instructions(with distance: CGFloat) -> String

    Parameters

    distance

    the distance to show in the instructions

    Return Value

    instructions with a certain distance instead of total

  • Declaration

    Objective-C

    - (CGFloat)distance;

    Swift

    func distance() -> CGFloat

    Return Value

    distance in meters

  • Declaration

    Objective-C

    - (CGFloat)duration;

    Swift

    func duration() -> CGFloat

    Return Value

    duration in seconds

  • Declaration

    Objective-C

    - (CGFloat)speed;

    Swift

    func speed() -> CGFloat

    Return Value

    meters per second

  • Declaration

    Objective-C

    - (nonnull SPLocation *)start;

    Swift

    func start() -> SPLocation

    Return Value

    starting location for the route step