GLRoute
@interface GLRoute : NSObject
Class to load route data
-
Finds index where given point must be inserted to array of reference points. It’s used, for example, to add waypoint to route.
Declaration
Objective-C
+ (NSUInteger)findInsertionIndex:(nonnull GLMapPoint *)point points:(nonnull const GLMapPoint *)points pointsCount:(NSInteger)pointsCount;Parameters
pointAt input defines point to insert. At output contains point that is located on route.
pointsArray of reference GLMapPoints
pointsCountNumber of points in array
Return Value
NSNotFound if given point is too far from track.
-
Returns track data that can be used to display track of route
Declaration
Objective-C
- (GLMapTrackData *_Nullable)trackDataWithColor:(GLMapColor)trackColor;Parameters
trackColorcolor of route track
Return Value
track data of route
-
Returns track data that can be used to display track of route
Declaration
Objective-C
- (GLMapTrackData *_Nullable)trackDataWithCallback: (nonnull GLMapTrackDataColorBlock)colorBlock;Parameters
colorBlockblock to generate gradient
Return Value
track data of route
-
Returns route target point at given index
Declaration
Objective-C
- (GLRoutePoint)targetPointAtIndex:(NSUInteger)index;Parameters
indexIndex of point in range [0 … targetPointsCount)
Return Value
target point t given index
-
Number of refrence points in route
Declaration
Objective-C
@property (atomic, readonly) NSUInteger targetPointsCount; -
Returns length of leg at given index
Declaration
Objective-C
- (double)lengthOfLeg:(NSUInteger)index;Parameters
indexIndex of point in range [0 … legsCount)
Return Value
length of leg at given index
-
Returns duration of leg at given index
Declaration
Objective-C
- (double)durationOfLeg:(NSUInteger)index;Parameters
indexIndex of point in range [0 … legsCount)
Return Value
duration of leg at given index
-
Number of legs
Declaration
Objective-C
@property (atomic, readonly) NSUInteger legsCount; -
Total length of route
Declaration
Objective-C
@property (atomic, readonly) double length; -
Estimated duration of the route
Declaration
Objective-C
@property (atomic, readonly) double duration; -
Finds maneuver that go after given manuver
Declaration
Objective-C
- (GLRouteManeuver *_Nullable)getNextManeuver: (nonnull GLRouteManeuver *)maneuver;Parameters
maneuverrefrence maneuver
Return Value
next maneuver of the route
-
Finds maneuver that go before given manuver
Declaration
Objective-C
- (GLRouteManeuver *_Nullable)getPreviousManeuver: (nonnull GLRouteManeuver *)maneuver;Parameters
maneuverrefrence maneuver
Return Value
previous maneuver of the route
-
Finds nearest point on route
Declaration
Objective-C
- (void)findNearestPoint:(nonnull GLMapPoint *)point height:(nonnull CGFloat *)height;Parameters
pointon input contains refrence point. on output contains nearest point
heightheight in result point or NAN if heightData is nil
-
Enumerates points in maneuver
Declaration
Objective-C
- (void)enumManeuverPoints:(nonnull GLRouteManeuver *)maneuver withBlock:(nonnull GLRouteManeuverEnumPointsBlock)block;Parameters
maneuverManeuver to enumerate
blockEnumerator block
-
All maneuvers of the route
Declaration
Objective-C
@property (atomic, readonly) NSArray<GLRouteManeuver *> *_Nonnull allManeuvers; -
Unparsed server response
Declaration
Objective-C
@property (atomic, readonly) NSString *_Nullable serverResponse; -
Language of instructions in maneuvers
Declaration
Objective-C
@property (atomic, readonly) NSString *_Nullable language; -
Height data
Declaration
Objective-C
@property (atomic, readonly) GLRouteElevation *_Nullable heightData;
Install in Dash
GLRoute Class Reference