This commit is contained in:
wangcongtao
2020-06-10 19:11:07 +08:00
4 changed files with 17 additions and 11 deletions

View File

@@ -59,9 +59,10 @@ public class RoadSearchClient implements IMogoRoadSearch, RouteSearch.OnRouteSea
}
}
RouteSearch.DriveRouteQuery searchQuery = new RouteSearch.DriveRouteQuery( fromAndTo, RouteSearch.DRIVING_SINGLE_SHORTEST, latLonPointWays, null, "" );
RouteSearch.DriveRouteQuery searchQuery = new RouteSearch.DriveRouteQuery( fromAndTo, RouteSearch.DRIVING_MULTI_CHOICE_AVOID_CONGESTION, latLonPointWays, null, "" );
if ( mRouteSearch == null ) {
mRouteSearch = new RouteSearch( context );
mRouteSearch.setRouteSearchListener(this);
}
mRouteSearch.calculateDriveRouteAsyn( searchQuery );
}
@@ -94,14 +95,18 @@ public class RoadSearchClient implements IMogoRoadSearch, RouteSearch.OnRouteSea
return;
}
List< MogoLatLng > points = new ArrayList<>();
Logger.d(TAG,"onDriveRouteSearched i : " + i);
if ( driveRouteResult == null
|| driveRouteResult.getPaths() == null
|| driveRouteResult.getPaths().isEmpty() ) {
Logger.d(TAG,"onDriveRouteSearched result is null");
mListener.onDrivePathSearched( null );
return;
}
DrivePath drivePath = driveRouteResult.getPaths().get( 0 );
int size = driveRouteResult.getPaths().size();
Logger.d(TAG,"onDriveRouteSearched driveRouteResult size : " + size);
List< DriveStep > steps = drivePath.getSteps();
if ( steps == null || steps.isEmpty() ) {
mListener.onDrivePathSearched( null );