Advertisement
Guest User

Untitled

a guest
Apr 28th, 2015
502
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.66 KB | None | 0 0
  1. private static void googleSample() throws Exception {
  2.         GeoApiContext ctx = new GeoApiContext();
  3.         ctx.setApiKey("AIzaSyApu75sD5ZG17luxoAOsZZtstiLnRe8f-0");
  4.         DirectionsApiRequest req = DirectionsApi.getDirections(ctx,
  5.                 "Киев, Борщаговская 148",
  6.                 "блаблабла"//"Киев, Бориспольськая 10"
  7.         );
  8.         DirectionsRoute[] routes = req.await();
  9.         for (DirectionsRoute route : routes) {
  10.             System.out.println(route.summary);
  11.             for (DirectionsLeg leg : route.legs) {
  12.                 System.out.println(leg.distance);
  13.             }
  14.         }
  15.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement