This commit is contained in:
zhangyuanzhen
2020-02-18 11:08:22 +08:00
parent eacd58faa8
commit c32b5f6a41

View File

@@ -82,9 +82,9 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
if ( mCalculatePathItems == null || mCalculatePathItems.isEmpty() ) {
return;
}
addEndPoints();
showPathsBound( mCalculatePathItems.get( 0 ).getPath().getBoundsForPath() );
renderPathOverlay( mCalculatePathItems );
addEndPoints();
}
/**
@@ -165,8 +165,8 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
if ( i == 0 ) {
mSelectedPathId = item.getId();
mSelectedCalculatePathItem = item;
wrapper.setStartBitmap( R.drawable.ic_navi_start )
.setEndBitmap( R.drawable.ic_navi_target );
//wrapper.setStartBitmap( R.drawable.ic_navi_start )
// .setEndBitmap( R.drawable.ic_navi_target );
mAMapNavi.selectRouteId( item.getId() );
}
wrapper.addToMap();
@@ -180,7 +180,11 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
}
Bitmap bitmap = BitmapFactory.decodeResource( mContext.getResources(), R.drawable.ic_endpoint );
Bitmap startBitmap = BitmapFactory.decodeResource( mContext.getResources(), R.drawable.ic_navi_start );
Bitmap endBitmap = BitmapFactory.decodeResource( mContext.getResources(), R.drawable.ic_navi_target );
MogoMarkerOptions options = new MogoMarkerOptions().icon( bitmap ).zIndex( 0 ).anchor( 0.5f, 0.5f );
MogoMarkerOptions startOptions = new MogoMarkerOptions().icon( startBitmap ).zIndex( 0 ).anchor( 0.5f, 1 );
MogoMarkerOptions endOptions = new MogoMarkerOptions().icon( endBitmap ).zIndex( 0 ).anchor( 0.5f, 1 );
for ( CalculatePathItem path : mCalculatePathItems ) {
List< MogoLatLng > points = path.getCoordList();
if ( points == null || points.isEmpty() ) {
@@ -193,6 +197,10 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
}
MogoMap.getInstance().getMogoMap().addMarker( TAG, options.latitude( startPoint.lat ).longitude( startPoint.lng ) );
MogoMap.getInstance().getMogoMap().addMarker( TAG, options.latitude( endPoint.lat ).longitude( endPoint.lng ) );
MogoMap.getInstance().getMogoMap().addMarker( TAG, startOptions.latitude( startPoint.lat ).longitude( startPoint.lng ) );
MogoMap.getInstance().getMogoMap().addMarker( TAG, endOptions.latitude( endPoint.lat ).longitude( endPoint.lng ) );
break;
}
}