Advertisement
colmulhall

Untitled

Apr 4th, 2014
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.71 KB | None | 0 0
  1.     private String getDirectionsUrl(LatLng origin,LatLng dest)
  2.     {
  3.         // Origin of route
  4.         String str_origin = "origin="+origin.latitude+","+origin.longitude;
  5.  
  6.         // Destination of route
  7.         String str_dest = "destination="+dest.latitude+","+dest.longitude;
  8.  
  9.         // Sensor enabled
  10.         String sensor = "sensor=false";
  11.  
  12.         // Building the parameters to the web service
  13.         String parameters = str_origin+"&"+str_dest+"&"+sensor+"&"+"mode="+mode;
  14.  
  15.         // Output format
  16.         String output = "json";
  17.  
  18.         // Building the url to the web service
  19.         url = "https://maps.googleapis.com/maps/api/directions/"+output+"?"+parameters;
  20.  
  21.         return url;
  22.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement