PWRoute Class Reference

Inherits from NSObject
Declared in PWRoute.h

Overview

The PWRoute class defines a single route that the user can follow between a requested start and end point. The route object defines the geometry for the route and includes route information you can display to the user, such as the name of the route, its distance and the expected travel time.

Do not create instances of this class directly. Instead, use createRouteFrom: to: options: completion:.

  campus

A reference to the route’s campus object.

@property (nonatomic, readonly, nullable) PWCampus *campus

Declared In

PWRoute.h

  building

A reference to the route’s building object.

@property (nonatomic, readonly, nullable) PWBuilding *building

Declared In

PWRoute.h

  startPoint

A reference to the origin, or start point, for the route.

@property (readonly) id<PWMapPoint> startPoint

Declared In

PWRoute.h

  endPoint

A reference to the destination, or end point, for the route.

@property (readonly) id<PWMapPoint> endPoint

Declared In

PWRoute.h

  __deprecated

A reference to the origin, or start point-of-interest, for the route. (Deprecated: Use startPoint instead, since v3.2.0.)

@property (nonatomic, readonly) PWPointOfInterest *__deprecated

Declared In

PWRoute.h

  routeInstructions

An array of PWRouteInstruction objects containing instructions to follow the route path.

@property (nonatomic, readonly, nullable) NSArray<PWRouteInstruction*> *routeInstructions

Declared In

PWRoute.h

  distance

An integer representing the total distance of the route expressed in meters.

@property (nonatomic, readonly) CLLocationDistance distance

Declared In

PWRoute.h

  estimatedTime

An integer representing the estimated time of the route expressed in seconds.

@property (nonatomic, readonly) NSInteger estimatedTime

Declared In

PWRoute.h

  accessible

A BOOL value that returns YES if the route was calculated with accessibility.

@property (nonatomic, readonly, getter=isAccessible) BOOL accessible

Declared In

PWRoute.h

+ initRouteFrom:to:accessibility:completion:

Instantiates a new PWRoute object using the given parameters. Calculates a route to navigate between the start POI and the end POI. The completion handler is called when the route is fully calculated. (Deprecated: use ‘createRouteFrom:to:options:completion:’ instead)

+ (void)initRouteFrom:(PWPointOfInterest *)startPoint to:(PWPointOfInterest *)endPoint accessibility:(BOOL)accessibility completion:(void ( ^ ) ( PWRoute *_Nullable route , NSError *_Nullable error ))completion

Parameters

startPoint

PWPointOfInterest object representing the start point for the route calculation.

endPoint

PWPointOfInterest object representing the end point for the route calculation.

accessibility

BOOL Value to tell the route init if accessibility should be considered to calculate the route.

completion

Completion handler that is called once the route’s calculation is complete.

Declared In

PWRoute.h

+ createRouteFrom:to:accessibility:excludedPoints:completion:

Instantiates a new PWRoute object using the given parameters. Calculates a route to navigate between the start PWMapPoint and the end PWMapPoint. The completion handler is called when the route is fully calculated. (Deprecated: use ‘createRouteFrom:to:options:completion:’ instead)

+ (void)createRouteFrom:(id<PWMapPoint>)startPoint to:(id<PWMapPoint>)endPoint accessibility:(BOOL)accessibility excludedPoints:(NSArray *_Nullable)excludedPoints completion:(void ( ^ ) ( PWRoute *_Nullable route , NSError *_Nullable error ))completion

Parameters

startPoint

A PWMapPoint object representing the start point for the route calculation.

endPoint

A PWMapPoint object representing the end point for the route calculation.

accessibility

A BOOL value to tell the route builder if accessibility should be considered to calculate the route.

excludedPoints

An array of PWMapPoint objects to be excluded when building the route.

completion

Completion handler that is called once the route’s calculation is complete.

Declared In

PWRoute.h

+ createRouteFrom:to:options:completion:

Instantiates a new PWRoute object using the given parameters. Calculates a route to navigate between the start PWMapPoint and the end PWMapPoint. The completion handler is called when the route is fully calculated.

+ (void)createRouteFrom:(id<PWMapPoint>)startPoint to:(id<PWMapPoint>)endPoint options:(PWRouteOptions *_Nullable)options completion:(void ( ^ ) ( PWRoute *_Nullable route , NSError *_Nullable error ))completion

Parameters

startPoint

A PWMapPoint object representing the start point for the route calculation.

endPoint

A PWMapPoint object representing the end point for the route calculation.

options

A PWRouteOptions object specifying the options to use for route calculation. if ‘nil’, default options will be used.

completion

Completion handler that is called once the route’s calculation is complete.

Declared In

PWRoute.h