Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SKRouteSettings route = new SKRouteSettings();
- // set start and destination points
- route.setStartCoordinate(start);
- route.setDestinationCoordinate(end);
- route.setNoOfRoutes(1);
- // set the route mode
- route.setRouteMode(SKRouteSettings.SKRouteMode.CAR_FASTEST);
- // Traffic enabled
- route.setUseLiveTraffic(true);
- route.setUseLiveTrafficETA(true);
- route.setTollRoadsAvoided(true);
- route.setAvoidFerries(true);
- route.setHighWaysAvoided(true);
- ArrayList<SKViaPoint> viaPoints = new ArrayList<SKViaPoint>();
- viaPoints.add(new SKViaPoint(VIA_POINT_ID_OTW_DEST, viaPoint));
- route.setViaPoints(viaPoints);
- // set whether the route should be shown on the map after it's computed
- route.setRouteExposed(true);
- // Set traffic routing mode
- SKRouteManager.getInstance().setTrafficRoutingMode(SKMapSettings.SKTrafficMode.FLOW_AND_INCIDENTS);
- // set the route listener to be notified of route calculation
- // events
- SKRouteManager.getInstance().setRouteListener(this);
- // pass the route to the calculation routine
- SKRouteManager.getInstance().calculateRoute(route);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement