IARoute
Objective-C
@interface IARoute : NSObject
Swift
class IARoute : NSObject
Structure representing a route from user’s location to destination.
-
An array of
IARouteLeg
objects connecting user’s location to destination.Declaration
Objective-C
@property (nonatomic, readonly, nonnull) NSArray<IARouteLeg *> *legs;
Swift
var legs: [IARouteLeg] { get }
-
Whether route is available
Declaration
Objective-C
@property (nonatomic, readonly) _Bool isSuccessful;
Swift
var isSuccessful: Bool { get }
-
Error status for routing
Declaration
Objective-C
@property (nonatomic, readonly) enum ia_route_error error;
Swift
var error: ia_route_error { get }
-
Create IARoute from array of IALatLngFloor objects. Every point indicates either a turn, start or destination in the route.
Declaration
Objective-C
+ (nonnull IARoute *)routeFromLatLngFloors: (nonnull NSArray<IALatLngFloor *> *)points;
Swift
/*not inherited*/ init(from points: [IALatLngFloor])
-
Create IARoute from a JSON description *
- Example json:
- {
- “legs”: [
- {
- “begin”: { “latitude”: …, “longitude”: …, “floor”: … },
- “end”: { “latitude”: …, “longitude”: …, “floor”: … },
- “length”: …
- “direction”: …
- },
- …
- ]
- } *
- If invalid JSON is given the error bit on the returned route will be set and isSuccessful returns false.
Declaration
Objective-C
+ (nonnull IARoute *)routeFromJson:(nonnull NSString *)json;
Swift
/*not inherited*/ init(fromJson json: String)