Can I enable traffic information when specifying the route options in calculateRoute function? I'm using here sdk in my application
This is my caclulateRoute function
final RouteOptions routeOptions = new RouteOptions();
routeOptions.setTruckLength(25);
routeOptions.setTruckHeight(5);
routeOptions.setTruckWidth(2.5f);
routeOptions.setTruckLimitedWeight(40);
routeOptions.setTruckWeightPerAxle(10);
routeOptions.setTruckTrailersCount(1);
RoutePlan routePlan = new RoutePlan();
routePlan.setRouteOptions(routeOptions);
for (GeoCoordinate coordinate : locations) {
RouteWaypoint routeWaypoint = new RouteWaypoint(coordinate);
routePlan.addWaypoint(routeWaypoint);
}
CoreRouter coreRouter = new CoreRouter();
coreRouter.setConnectivity(CoreRouter.Connectivity.DEFAULT);
coreRouter.calculateRoute(routePlan,.......
I was asking is there any way to specify that we should consider traffic information also while calculating route.
Assuming you are talking about the Premium SDK (since you refer already to Core router anyway):
The CoreRouter has a method:
setDynamicPenalty(DynamicPenalty penalty)
One of the "penalty" modes is TrafficPenalty:
setTrafficPenaltyMode(Route.TrafficPenaltyMode mode)
Setting the traffic penalty mode to OPTIMAL is probably what you are looking for.