Class GLRouteRequest


  • @ParametersAreNonnullByDefault
    public class GLRouteRequest
    extends java.lang.Object
    GLMapRouteData used request online or offline route.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  GLRouteRequest.ResultsCallback
      Callback that will be called when request is finished
    • Constructor Summary

      Constructors 
      Constructor Description
      GLRouteRequest()
      Default constructor
      GLRouteRequest​(java.lang.String userJSON)
      Constructor with custom json request to valhalla
    • Method Summary

      Modifier and Type Method Description
      void addPoint​(GLRoutePoint point)
      Adds point
      static void cancel​(long requestID)
      Cancels request that was started
      java.lang.String getLocale()  
      int getMode()  
      int getUnitSystem()  
      boolean isOptimize()  
      void setLocale​(java.lang.String locale)
      Sets locale for instructions.
      void setMode​(int mode)
      Sets mode of the route.
      void setOfflineWithConfig​(java.lang.String config)
      Makes request offline
      void setOptimize​(boolean optimize)
      if YES order of middle points can be changed to make route faster.
      void setUnitSystem​(int unitSystem)
      Sets unit system for instructions.
      long start​(GLRouteRequest.ResultsCallback callback)
      Start request
      • Methods inherited from class java.lang.Object

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

      • GLRouteRequest

        public GLRouteRequest()
        Default constructor
      • GLRouteRequest

        public GLRouteRequest​(java.lang.String userJSON)
        Constructor with custom json request to valhalla
        Parameters:
        userJSON - json request to valhalla
    • Method Detail

      • addPoint

        public void addPoint​(GLRoutePoint point)
        Adds point
        Parameters:
        point - point to add
      • setOfflineWithConfig

        public void setOfflineWithConfig​(java.lang.String config)
        Makes request offline
        Parameters:
        config - Contents of configuration file for routing engine Valhalla. See valhalla.json inside the demoApp.
      • setOptimize

        public void setOptimize​(boolean optimize)
        if YES order of middle points can be changed to make route faster. By default is NO.
        Parameters:
        optimize - if YES order of middle points can be changed to make route faster. By default is NO.
      • isOptimize

        public boolean isOptimize()
      • setMode

        public void setMode​(int mode)
        Sets mode of the route. By default GLRoute.Mode.DRIVE
        Parameters:
        mode - mode to set
      • getMode

        public int getMode()
      • setUnitSystem

        public void setUnitSystem​(int unitSystem)
        Sets unit system for instructions. By default GLUnitSystem.International
        Parameters:
        unitSystem - system to set
      • getUnitSystem

        public int getUnitSystem()
      • setLocale

        public void setLocale​(java.lang.String locale)
        Sets locale for instructions. By default equal to `Locale.getDefault().getLanguage()`
        Parameters:
        locale - locale to set
      • getLocale

        public java.lang.String getLocale()
      • cancel

        public static void cancel​(long requestID)
        Cancels request that was started
        Parameters:
        requestID - ID of request to cancel