高德地图驾车路线规划怎么自己绘制线路?非导航的那种路线规划。
@Override
public void onDriveRouteSearched(DriveRouteResult result, int rCode) {
Log.i(TAG, "test---onDriveRouteSearched---" + rCode);
dissmissProgressDialog();
if (rCode == 0) {
if (result != null && result.getPaths() != null && result.getPaths().size() > 0) {
driveRouteResult = result;
DrivePath drivePath = driveRouteResult.getPaths();
aMap.clear();// 清理地图上的所有覆盖物
// drivingRouteOverlay = new MyDrivingRouteOverlay(this, aMap, drivePath, driveRouteResult.getStartPos(),
// driveRouteResult.getTargetPos(), showCarInfo);
// AMapNaviPath naviPath = mAmapNavi.getNaviPath();
List<DrivePath> naviPath = driveRouteResult.getPaths();
Log.i(TAG, "naviPath==" + naviPath);
if (naviPath != null) {
if (pointList == null) {
pointList = new ArrayList<LatLng>();
}
pointList.clear();
for (DrivePath naviLatLng : naviPath) {
pointList.add(new LatLng(naviLatLng.getLatitude(),
naviLatLng.getLongitude()));
}