opt
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.mogo.map.impl.amap.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.navi.AMapNavi;
|
||||
@@ -170,6 +171,13 @@ public class NaviClient implements IMogoNavi {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ) {
|
||||
if ( mAMapNaviListener != null ) {
|
||||
mAMapNaviListener.setCalculatePathDisplayBounds(bounds);
|
||||
}
|
||||
}
|
||||
|
||||
// -- end
|
||||
|
||||
private boolean checkAMapNavi() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.mogo.map.impl.amap.navi;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Rect;
|
||||
|
||||
import com.amap.api.maps.model.Polyline;
|
||||
import com.amap.api.navi.AMapNavi;
|
||||
@@ -185,4 +186,10 @@ public class NaviListenerAdapter extends AMapNaviListenerAdapter {
|
||||
mNaviOverlayHelper.clearCalculatedOverlay();
|
||||
}
|
||||
}
|
||||
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ){
|
||||
if ( mNaviOverlayHelper != null ) {
|
||||
mNaviOverlayHelper.setCalculatePathDisplayBounds(bounds);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
|
||||
|
||||
private int mSelectedPathId;
|
||||
private CalculatePathItem mSelectedCalculatePathItem;
|
||||
private SoftReference< OnCalculatePathItemClickInteraction > mLineClickInteractionRef;
|
||||
private OnCalculatePathItemClickInteraction mLineClickInteraction;
|
||||
|
||||
public NaviOverlayHelper( AMapNavi mAMapNavi, AMap mAMap, Context mContext ) {
|
||||
this.mAMapNavi = mAMapNavi;
|
||||
@@ -157,7 +157,7 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
|
||||
if ( i == 0 ) {
|
||||
mSelectedPathId = item.getId();
|
||||
mSelectedCalculatePathItem = item;
|
||||
wrapper.setStartBitmap( R.drawable.ic_search_poi_location ).setEndBitmap( R.drawable.ic_search_choice_point );
|
||||
wrapper.setStartBitmap( R.drawable.ic_navi_start ).setEndBitmap( R.drawable.ic_navi_target );
|
||||
mAMapNavi.selectRouteId( item.getId() );
|
||||
}
|
||||
wrapper.addToMap();
|
||||
@@ -196,8 +196,8 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
|
||||
if ( mPaths != null && !mPaths.isEmpty() ) {
|
||||
for ( MogoCalculatePath path : mPaths ) {
|
||||
if ( TextUtils.equals( path.getTagId(), polyline.getId() ) ) {
|
||||
if ( mLineClickInteractionRef != null && mLineClickInteractionRef.get() != null ) {
|
||||
mLineClickInteractionRef.get().onItemClicked( path.getTagId() );
|
||||
if ( mLineClickInteraction != null ) {
|
||||
mLineClickInteraction.onItemClicked( path.getTagId() );
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -317,9 +317,12 @@ public class NaviOverlayHelper implements OnCalculatePathItemClickInteraction {
|
||||
}
|
||||
|
||||
public void setLineClickInteraction( OnCalculatePathItemClickInteraction lineClickInteraction ) {
|
||||
if ( mLineClickInteractionRef != null ) {
|
||||
mLineClickInteractionRef.clear();
|
||||
mLineClickInteraction = lineClickInteraction;
|
||||
}
|
||||
|
||||
public void setCalculatePathDisplayBounds( Rect bounds ) {
|
||||
if ( bounds != null ) {
|
||||
mBoundRect = bounds;
|
||||
}
|
||||
mLineClickInteractionRef = new SoftReference<>( lineClickInteraction );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user