This commit is contained in:
wangcongtao
2020-04-01 19:06:55 +08:00
parent e89629a3d3
commit b32663da91
11 changed files with 47 additions and 45 deletions

View File

@@ -41,6 +41,7 @@ public class NaviClient implements IMogoNavi {
/**
* 导航策略配置
*/
private MogoNaviConfig mMogoNaviConfig = new MogoNaviConfig();
private static volatile NaviClient sInstance;

View File

@@ -158,6 +158,7 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
@Override
public void onStartNavi( int type ) {
Logger.d( TAG, "onStartNavi type = %s", type );
// 巡航
if ( type != NaviType.CRUISE ) {
setStopped( false );
@@ -223,13 +224,9 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
super.onCalculateRouteSuccess( aMapCalcRouteResult );
Logger.i( TAG, "导航规划成功" );
setStopped( false );
WorkThreadHandler.getInstance().post( ()->{
mNaviOverlayHelper.showCalculatedPaths(()->{
UiThreadHandler.post( ()->{
MogoNaviListenerHandler.getInstance().onCalculateSuccess();
AMapMessageManager.getInstance().postCalculateSuccess();
} );
});
mNaviOverlayHelper.showCalculatedPaths( () -> {
AMapMessageManager.getInstance().postCalculateSuccess();
MogoNaviListenerHandler.getInstance().onCalculateSuccess();
} );
}

View File

@@ -170,6 +170,7 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
}
public void showBounds() {
Logger.d( TAG, "showBounds" );
showPathsBound( getBounds(), null );
}
@@ -187,11 +188,9 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
mBoundRect.right,
mBoundRect.top,
mBoundRect.bottom ));
UiThreadHandler.postDelayed( ()->{
if ( after != null ) {
after.run();
}
}, 2000 );
if ( after != null ) {
after.run();
}
}
private void checkAMapInstance() {
@@ -218,6 +217,7 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
//wrapper.setStartBitmap( R.drawable.ic_navi_start )
// .setEndBitmap( R.drawable.ic_navi_target );
mAMapNavi.selectRouteId( item.getId() );
Logger.d( TAG, "renderPathOverlay set default path" );
}
wrapper.addToMap();
wrapper.setTransparency( i == 0 ? AMAP_ROUTE_OVERLAY_TRANSPARENCY_SELECTED : AMAP_ROUTE_OVERLAY_TRANSPARENCY_UNSELECTED );