Class GLRouteBuilder

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

public class GLRouteBuilder extends GLNativeObject
GLRouteBuilder used construct custom routes.
  • 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 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.