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
public void onSuccess(PathLineResult o) {
//绘制线路线
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) {
drawMapLine(o.getPointList());
if (o != null && o.getResult() != null && o.getResult().getPointList() != null
&& o.getResult().getPointList().size() > 0) {
drawMapLine(o.getResult().getPointList());
} else {
Logger.e(TAG, "getRoadLineData onSuccess o.getPointList() == null");
Log.e(TAG, "getRoadLineData onSuccess o.getPointList() == null");
}
}
@Override
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
public void onSuccess(PathLineResult o) {
//绘制线路线
if (o != null && o.getPointList() != null && o.getPointList().size() > 0) {
drawMapLine(o.getPointList());
if (o != null && o.getResult() != null && o.getResult().getPointList() != null
&& o.getResult().getPointList().size() > 0) {
drawMapLine(o.getResult().getPointList());
} else {
Logger.e(TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null");
Log.e(TAG, "getNaviRoadLineInfo onSuccess o.getPointList() == null");
}
}
@Override
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) {
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();
passedByPoints = new ArrayList<>();

View File

@@ -9,22 +9,35 @@ import java.util.List;
* @since 2020-01-08
*/
public class PathLineResult extends BaseData {
private List<Information> informations;
private List<Center> pointList;
public List<Information> getInformations() {
return informations;
private PathResult result;
public PathResult getResult() {
return result;
}
public void setInformations(List<Information> informations) {
this.informations = informations;
public void setResult(PathResult result) {
this.result = result;
}
public List<Center> getPointList() {
return pointList;
}
public static class PathResult {
private List<Information> informations;
private List<Center> pointList;
public void setPointList(List<Center> pointList) {
this.pointList = pointList;
public List<Information> getInformations() {
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
public void onError(Throwable e) {
super.onError(e);
e.printStackTrace();
Logger.d(TAG, "getRoadLineData onError ------> e= " + e.getMessage());
}
});
@@ -165,6 +166,7 @@ public class TanluModelData {
@Override
public void onError(Throwable e) {
super.onError(e);
e.printStackTrace();
Logger.d(TAG, "getNaviRoadLineInfo onError ------> e= " + e.getMessage());
}
});