Package globus.glroute
Class GLRouteBuilder
java.lang.Object
globus.glmap.GLNativeObject
globus.glroute.GLRouteBuilder
Builds custom routes programmatically (maneuvers, geometry, and instructions).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLane(int directions, int valid, int active) Adds lane metadata for the previously added maneuver.voidaddLine(GLMapVectorObject line) Adds all polyline segments from the specified vector object as maneuvers.voidaddManeuver(int type, MapPoint[] points, float[] heights) Adds a maneuver to the route.voidaddTargetPoint(GLRoutePoint point) Adds a target point to the route.build()Finalizes the route construction and validates it.voidsetLanguage(String language) Sets the language for maneuver instructions.voidsetManeuverInstruction(int type, String instruction) Sets a short instruction for the previously added maneuver.voidsetManeuverShortInstruction(String instruction) Sets the short instruction (e.g., "Exit 3A → AZ 202 Loop East") for the previously added maneuver.voidsetManeuverTime(double maneuverTime) Sets the time for the maneuver.voidsetManeuverTransitionInstruction(String instruction) Sets the transition instruction text for the previously added maneuver.voidsetManeuverVerbalPostTransitionInstruction(String instruction) Sets the verbal post-transition instruction for the previously added maneuver.voidsetManeuverVerbalPreTransitionInstruction(String instruction) Sets the verbal pre-transition instruction for the previously added maneuver.voidsetManeuverVerbalTransitionInstruction(String instruction) Sets the verbal transition instruction for the previously added maneuver.Methods inherited from class globus.glmap.GLNativeObject
dispose
-
Constructor Details
-
GLRouteBuilder
public GLRouteBuilder()Default constructor
-
-
Method Details
-
setLanguage
Sets the language for maneuver instructions.- Parameters:
language- The language code (e.g., "en", "fr") for the maneuver instructions.
-
addTargetPoint
Adds a target point to the route.- Parameters:
point- TheGLRoutePointto add.
-
addManeuver
Adds a maneuver to the route.- Parameters:
type- The type of the maneuver, defined byGLRouteManeuver.Type.points- An array ofMapPointobjects representing the points of the maneuver.heights- An optional array of heights corresponding to the points, ornullif not applicable.
-
addLine
Adds all polyline segments from the specified vector object as maneuvers.The object must contain line geometry; each segment is appended as a
StayStraightmaneuver, and the builder automatically appends a finalDestinationmaneuver.- Parameters:
line- TheGLMapVectorObjectcontaining the line geometry to append.
-
setManeuverTime
public void setManeuverTime(double maneuverTime) Sets the time for the maneuver.- Parameters:
maneuverTime- The time for the maneuver in seconds.
-
setManeuverInstruction
Sets a short instruction for the previously added maneuver.- Parameters:
type- The type of instruction to set, defined byGLRouteManeuver.InstructionType.instruction- The text of the instruction.
-
setManeuverShortInstruction
Sets the short instruction (e.g., "Exit 3A → AZ 202 Loop East") for the previously added maneuver.- Parameters:
instruction- The short instruction text.
-
setManeuverTransitionInstruction
Sets the transition instruction text for the previously added maneuver.- Parameters:
instruction- The transition instruction text.
-
setManeuverVerbalPreTransitionInstruction
Sets the verbal pre-transition instruction for the previously added maneuver.- Parameters:
instruction- The verbal pre-transition instruction text.
-
setManeuverVerbalTransitionInstruction
Sets the verbal transition instruction for the previously added maneuver.- Parameters:
instruction- The verbal transition instruction text.
-
setManeuverVerbalPostTransitionInstruction
Sets the verbal post-transition instruction for the previously added maneuver.- Parameters:
instruction- The verbal post-transition instruction text.
-
addLane
public void addLane(int directions, int valid, int active) Adds lane metadata for the previously added maneuver.- Parameters:
directions- Mask with all possible directions for the lane.valid- Mask with directions valid for entering the maneuver initially.active- Mask with directions that keep the user on route without additional lane changes.
-
build
Finalizes the route construction and validates it.- Returns:
- A
GLRouteobject representing the built route, ornullif the route is invalid.
-