fix bug of roadsearch listener
This commit is contained in:
@@ -88,7 +88,7 @@ android {
|
||||
// 是否使用自定义导航
|
||||
buildConfigField 'boolean', 'USE_CUSTOM_NAVI', 'true'
|
||||
// 是否作为 launcher 运行
|
||||
buildConfigField 'boolean', 'IS_LAUNCHER', 'true'
|
||||
buildConfigField 'boolean', 'IS_LAUNCHER', 'false'
|
||||
}
|
||||
// f系列-分体机全系列,未细分
|
||||
f8xx{
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<!-- android:exported="true" />-->
|
||||
<meta-data
|
||||
android:name="com.amap.api.v2.apikey"
|
||||
android:value="40e2e7e773c7562b1f2b13699a93992c"
|
||||
android:value="a36b9f7b086fa3951bb35338a5a06dd3"
|
||||
tools:replace="android:value" />
|
||||
<!-- 高德地图 -->
|
||||
</application>
|
||||
|
||||
@@ -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 );
|
||||
|
||||
Reference in New Issue
Block a user