Class GLRouteBuilder

java.lang.Object
globus.glmap.GLNativeObject
globus.glroute.GLRouteBuilder

public class GLRouteBuilder extends globus.glmap.GLNativeObject
GLRouteBuilder used construct custom routes.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addManeuver(int type, globus.glmap.MapPoint[] points, float[] heights)
    Adds a maneuver to the route.
    Finalizes the route construction and validates it.
    void
    setLanguage(String language)
    Sets the language for maneuver instructions.
    void
    setManeuverInstruction(int type, String instruction)
    Sets a short instruction for the previously added maneuver.
    void
    setManeuverTime(double maneuverTime)
    Sets the time for the maneuver.

    Methods inherited from class globus.glmap.GLNativeObject

    dispose

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GLRouteBuilder

      public GLRouteBuilder()
      Default constructor
  • Method Details

    • setLanguage

      public void setLanguage(@NonNull String language)
      Sets the language for maneuver instructions.
      Parameters:
      language - The language code (e.g., "en", "fr") for the maneuver instructions.
    • addManeuver

      public void addManeuver(int type, @NonNull globus.glmap.MapPoint[] points, @Nullable float[] heights)
      Adds a maneuver to the route.
      Parameters:
      type - The type of the maneuver, defined by GLRouteManeuver.Type.
      points - An array of MapPoint objects representing the points of the maneuver.
      heights - An optional array of heights corresponding to the points, or null if not applicable.
    • setManeuverTime

      public void setManeuverTime(double maneuverTime)
      Sets the time for the maneuver.
      Parameters:
      maneuverTime - The time for the maneuver in seconds.
    • setManeuverInstruction

      public void setManeuverInstruction(int type, @NonNull String instruction)
      Sets a short instruction for the previously added maneuver.
      Parameters:
      type - The type of instruction to set, defined by GLRouteManeuver.InstructionType.
      instruction - The text of the instruction.
    • build

      @Nullable public GLRoute build()
      Finalizes the route construction and validates it.
      Returns:
      A GLRoute object representing the built route, or null if the route is invalid.