Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public ResponseGooleMaps[] getRoute(LatLng startPoint,
- GeoAddress entdPoint) {
- String startPointCordinats = startPoint.latitude + "," + startPoint.longitude;
- final ResponseGooleMaps[] body = new ResponseGooleMaps[1];
- googleMapApi.getRoute("false",
- "ru",
- "driving",
- startPointCordinats,
- entdPoint.getName(),
- GOOGLE_MAP_KEY).enqueue(new Callback<ResponseGooleMaps>() {
- @Override
- public void onResponse(Call<ResponseGooleMaps> call, Response<ResponseGooleMaps> response) {
- if (response.isSuccessful()) {
- body[0] = response.body();
- Log.d(LOG_TEG, "overview_polyline \n" + body[0]);
- } else {
- try {
- response.errorBody().string();
- //TODO finish the text of an error
- Log.e(LOG_TEG, " errorBody: " + response.errorBody().string());
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
- @Override
- public void onFailure(Call<ResponseGooleMaps> call, Throwable t) {
- }
- });
- return body;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement