add road line

This commit is contained in:
lixiaopeng
2020-01-17 15:16:33 +08:00
parent 70d2e92560
commit dd628c628a
3 changed files with 37 additions and 20 deletions

View File

@@ -913,16 +913,17 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override @Override
public void onSuccess(PathLineResult o) { public void onSuccess(PathLineResult o) {
//绘制线路线 //绘制线路线
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) { if (o != null && o.getResult() != null && o.getResult().getPointList() != null
drawMapLine(o.getPointList()); && o.getResult().getPointList().size() > 0) {
drawMapLine(o.getResult().getPointList());
} else { } else {
Logger.e(TAG, "getRoadLineData onSuccess o.getPointList() == null"); Log.e(TAG, "getRoadLineData onSuccess o.getPointList() == null");
} }
} }
@Override @Override
public void onFail(String message, int code) { public void onFail(String message, int code) {
Logger.d(TAG, "getRoadLineData onFail message =" + message + ">>>code =" + code); Log.e(TAG, "getRoadLineData onFail message =" + message + ">>>code =" + code);
} }
}); });
} }
@@ -935,16 +936,17 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
@Override @Override
public void onSuccess(PathLineResult o) { public void onSuccess(PathLineResult o) {
//绘制线路线 //绘制线路线
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) { if (o != null && o.getResult() != null && o.getResult().getPointList() != null
drawMapLine(o.getPointList()); && o.getResult().getPointList().size() > 0) {
drawMapLine(o.getResult().getPointList());
} else { } else {
Logger.e(TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null"); Log.e(TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null");
} }
} }
@Override @Override
public void onFail(String message, int code) { public void onFail(String message, int code) {
Logger.d(TAG, "getNaviRoadLineInfo onFail message =" + message + ">>>code =" + code); Log.e(TAG, "getNaviRoadLineInfo onFail message =" + message + ">>>code =" + code);
} }
}); });
} }
@@ -954,7 +956,7 @@ public class TanluCardViewFragment extends MvpFragment<IView, Presenter<IView>>
*/ */
private void drawMapLine(List<Center> pointList) { private void drawMapLine(List<Center> pointList) {
int intervalNum = Utils.getIntervalValue(pointList.size()); int intervalNum = Utils.getIntervalValue(pointList.size());
Logger.d(TAG, "drawMapLine intervalNum = $intervalNum -- pointList.size = ${pointList.size}"); Logger.d(TAG, "drawMapLine intervalNum = " + intervalNum + ">>> pointList.size =" + pointList.size());
int listSize = pointList.size(); int listSize = pointList.size();
passedByPoints = new ArrayList<>(); passedByPoints = new ArrayList<>();

View File

@@ -9,22 +9,35 @@ import java.util.List;
* @since 2020-01-08 * @since 2020-01-08
*/ */
public class PathLineResult extends BaseData { public class PathLineResult extends BaseData {
private List<Information> informations;
private List<Center> pointList;
public List<Information> getInformations() { private PathResult result;
return informations;
public PathResult getResult() {
return result;
} }
public void setInformations(List<Information> informations) { public void setResult(PathResult result) {
this.informations = informations; this.result = result;
} }
public List<Center> getPointList() { public static class PathResult {
return pointList; private List<Information> informations;
} private List<Center> pointList;
public void setPointList(List<Center> pointList) { public List<Information> getInformations() {
this.pointList = pointList; return informations;
}
public void setInformations(List<Information> informations) {
this.informations = informations;
}
public List<Center> getPointList() {
return pointList;
}
public void setPointList(List<Center> pointList) {
this.pointList = pointList;
}
} }
} }

View File

@@ -129,6 +129,7 @@ public class TanluModelData {
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {
super.onError(e); super.onError(e);
e.printStackTrace();
Logger.d(TAG, "getRoadLineData onError ------> e= " + e.getMessage()); Logger.d(TAG, "getRoadLineData onError ------> e= " + e.getMessage());
} }
}); });
@@ -165,6 +166,7 @@ public class TanluModelData {
@Override @Override
public void onError(Throwable e) { public void onError(Throwable e) {
super.onError(e); super.onError(e);
e.printStackTrace();
Logger.d(TAG, "getNaviRoadLineInfo onError ------> e= " + e.getMessage()); Logger.d(TAG, "getNaviRoadLineInfo onError ------> e= " + e.getMessage());
} }
}); });