Package com.getyourmap.glroute
Class GLRouteRequest
- java.lang.Object
-
- com.getyourmap.glroute.GLRouteRequest
-
@ParametersAreNonnullByDefault public class GLRouteRequest extends java.lang.ObjectGLMapRouteDataused request online or offline route.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceGLRouteRequest.ResultsCallbackCallback that will be called when request is finished
-
Constructor Summary
Constructors Constructor Description GLRouteRequest()Default constructorGLRouteRequest(java.lang.String userJSON)Constructor with custom json request to valhalla
-
Method Summary
Modifier and Type Method Description voidaddPoint(GLRoutePoint point)Adds pointstatic voidcancel(long requestID)Cancels request that was startedjava.lang.StringgetLocale()intgetMode()intgetUnitSystem()booleanisOptimize()voidsetLocale(java.lang.String locale)Sets locale for instructions.voidsetMode(int mode)Sets mode of the route.voidsetOfflineWithConfig(java.lang.String config)Makes request offlinevoidsetOptimize(boolean optimize)if YES order of middle points can be changed to make route faster.voidsetUnitSystem(int unitSystem)Sets unit system for instructions.longstart(GLRouteRequest.ResultsCallback callback)Start request
-
-
-
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()
-
start
public long start(GLRouteRequest.ResultsCallback callback)
Start request- Parameters:
callback- results callback- Returns:
- id of task
-
cancel
public static void cancel(long requestID)
Cancels request that was started- Parameters:
requestID- ID of request to cancel
-
-