SPRouteStep
Objective-C
@interface SPRouteStep : NSObject
Swift
class 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
coordinatescontains coordinate points in the following format: [ [lat, lon, floor], …]
distancedistance for step in meters
instructionsused 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], …]
-
Return Value
action type for route step
-
Declaration
Objective-C
- (nonnull NSString *)instructions;Swift
func instructions() -> StringReturn 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) -> StringParameters
distancethe distance to show in the instructions
Return Value
instructions with a certain distance instead of total
-
Declaration
Objective-C
- (CGFloat)distance;Swift
func distance() -> CGFloatReturn Value
distance in meters
-
Declaration
Objective-C
- (CGFloat)duration;Swift
func duration() -> CGFloatReturn Value
duration in seconds
-
Declaration
Objective-C
- (CGFloat)speed;Swift
func speed() -> CGFloatReturn Value
meters per second
-
Return Value
starting location for the route step
SPRouteStep Class Reference