Advertisement
Denisimus

Untitled

Jun 3rd, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.38 KB | None | 0 0
  1.   public ResponseGooleMaps[] getRoute(LatLng startPoint,
  2.                                         GeoAddress entdPoint) {
  3.  
  4.         String startPointCordinats = startPoint.latitude + "," + startPoint.longitude;
  5.         final ResponseGooleMaps[] body = new ResponseGooleMaps[1];
  6.         googleMapApi.getRoute("false",
  7.                 "ru",
  8.                 "driving",
  9.                 startPointCordinats,
  10.                 entdPoint.getName(),
  11.                 GOOGLE_MAP_KEY).enqueue(new Callback<ResponseGooleMaps>() {
  12.             @Override
  13.             public void onResponse(Call<ResponseGooleMaps> call, Response<ResponseGooleMaps> response) {
  14.                 if (response.isSuccessful()) {
  15.                      body[0] = response.body();
  16.                     Log.d(LOG_TEG, "overview_polyline \n" + body[0]);
  17.  
  18.  
  19.  
  20.  
  21.                 } else {
  22.                     try {
  23.  
  24.                         response.errorBody().string();
  25.                         //TODO finish the text of an error
  26.                         Log.e(LOG_TEG, " errorBody: " + response.errorBody().string());
  27.  
  28.  
  29.                     } catch (IOException e) {
  30.                         e.printStackTrace();
  31.                     }
  32.                 }
  33.             }
  34.  
  35.             @Override
  36.             public void onFailure(Call<ResponseGooleMaps> call, Throwable t) {
  37.  
  38.             }
  39.         });
  40.  
  41.         return body;
  42.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement