GLRouteBuilder

Objective-C


@interface GLRouteBuilder : NSObject

Swift

class GLRouteBuilder : NSObject

GLRouteBuilder is a class that constructs custom routes with user-defined maneuvers and target points.

  • Default initializer.

    Declaration

    Objective-C

    - (nonnull instancetype)init;

    Swift

    init()

    Return Value

    A new GLRouteBuilder instance.

  • Sets the language of the maneuvers.

    Declaration

    Objective-C

    - (void)setLanguage:(nonnull NSString *)language;

    Swift

    func setLanguage(_ language: String)

    Parameters

    language

    The language of the maneuvers, specified as a 2-letter ISO-639-1 language code.

  • Adds a target point to the route.

    Declaration

    Objective-C

    - (void)addTargetPoint:(GLRoutePoint)point;

    Swift

    func addTargetPoint(_ point: GLRoutePoint)

    Parameters

    point

    The target point (in geographic coordinates) to add to the route.

  • Adds a new maneuver to the route.

    Declaration

    Objective-C

    - (void)addManeuver:(GLManeuverType)type
                 points:(nonnull const GLMapPoint *)points
                heights:(const float *_Nullable)heights
         numberOfPoints:(uint32_t)numberOfPoints;

    Swift

    func add(_ type: GLManeuverType, points: UnsafePointer<GLMapPoint>, heights: UnsafePointer<Float>?, numberOfPoints: UInt32)

    Parameters

    type

    The type of the maneuver.

    points

    An array of points that represents the maneuver’s geometry in internal map coordinates (GLMapPoint).

    heights

    An array of heights at each point in the points array, or NULL if height data is not available.

    numberOfPoints

    The number of points (and heights, if applicable) in the arrays.

  • Adds the maneuvers from a line to the route.

    Declaration

    Objective-C

    - (void)addLine:(nonnull GLMapVectorLine *)line;

    Swift

    func add(_ line: GLMapVectorLine)

    Parameters

    line

    A GLMapVectorLine object representing a line with maneuvers.

  • Sets the time for the most recently added maneuver.

    Declaration

    Objective-C

    - (void)setManeuverTime:(double)maneuverTime;

    Swift

    func setManeuverTime(_ maneuverTime: Double)

    Parameters

    maneuverTime

    The time (in seconds) to set.

  • Sets the short instruction for the most recently added maneuver.

    Declaration

    Objective-C

    - (void)setManeuverShortInstruction:(nonnull NSString *)instruction;

    Swift

    func setManeuverShortInstruction(_ instruction: String)

    Parameters

    instruction

    The short instruction text to set.

  • Sets the transition instruction for the most recently added maneuver.

    Declaration

    Objective-C

    - (void)setManeuverTransitionInstruction:(nonnull NSString *)instruction;

    Swift

    func setManeuverTransitionInstruction(_ instruction: String)

    Parameters

    instruction

    The transition instruction text to set.

  • Sets the verbal pre-transition instruction for the most recently added maneuver.

    Declaration

    Objective-C

    - (void)setManeuverVerbalPreTransitionInstruction:
        (nonnull NSString *)instruction;

    Swift

    func setManeuverVerbalPreTransitionInstruction(_ instruction: String)

    Parameters

    instruction

    The verbal pre-transition instruction text to set.

  • Sets the verbal transition instruction for the most recently added maneuver.

    Declaration

    Objective-C

    - (void)setManeuverVerbalTransitionInstruction:(nonnull NSString *)instruction;

    Swift

    func setManeuverVerbalTransitionInstruction(_ instruction: String)

    Parameters

    instruction

    The verbal transition instruction text to set.

  • Sets the verbal post-transition instruction for the most recently added maneuver.

    Declaration

    Objective-C

    - (void)setManeuverVerbalPostTransitionInstruction:
        (nonnull NSString *)instruction;

    Swift

    func setManeuverVerbalPostTransitionInstruction(_ instruction: String)

    Parameters

    instruction

    The verbal post-transition instruction text to set.

  • Adds a lane to the previously added maneuver.

    Declaration

    Objective-C

    - (void)addLane:(GLRouteTurnLaneMask)directions
              valid:(GLRouteTurnLaneMask)valid
             active:(GLRouteTurnLaneMask)active;

    Swift

    func add(_ directions: GLRouteTurnLaneMask, valid: GLRouteTurnLaneMask, active: GLRouteTurnLaneMask)

    Parameters

    directions

    A mask indicating all possible directions for the lane.

    valid

    A mask indicating directions that are valid for the initial maneuver but may require further lane changes later.

    active

    A mask indicating directions that are active and do not require additional lane changes to stay on route.

  • Validates the accumulated data and builds a new route.

    Declaration

    Objective-C

    - (GLRoute *_Nullable)build;

    Swift

    func build() -> GLRoute?

    Return Value

    A new GLRoute instance, or nil if the builder data is invalid/incomplete.