Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. SKRouteSettings route = new SKRouteSettings();
  2. // set start and destination points
  3. route.setStartCoordinate(start);
  4. route.setDestinationCoordinate(end);
  5. route.setNoOfRoutes(1);
  6. // set the route mode
  7. route.setRouteMode(SKRouteSettings.SKRouteMode.CAR_FASTEST);
  8. // Traffic enabled
  9. route.setUseLiveTraffic(true);
  10. route.setUseLiveTrafficETA(true);
  11.  
  12. route.setTollRoadsAvoided(true);
  13. route.setAvoidFerries(true);
  14. route.setHighWaysAvoided(true);
  15.  
  16. ArrayList<SKViaPoint> viaPoints = new ArrayList<SKViaPoint>();
  17. viaPoints.add(new SKViaPoint(VIA_POINT_ID_OTW_DEST, viaPoint));
  18. route.setViaPoints(viaPoints);
  19. // set whether the route should be shown on the map after it's computed
  20. route.setRouteExposed(true);
  21. // Set traffic routing mode
  22. SKRouteManager.getInstance().setTrafficRoutingMode(SKMapSettings.SKTrafficMode.FLOW_AND_INCIDENTS);
  23. // set the route listener to be notified of route calculation
  24. // events
  25. SKRouteManager.getInstance().setRouteListener(this);
  26. // pass the route to the calculation routine
  27. SKRouteManager.getInstance().calculateRoute(route);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement