[2.11.0 fix] 空指针异常
This commit is contained in:
@@ -144,26 +144,29 @@ public class CoordinateCalculateRouteUtil {
|
||||
if (mRoutePoints.size() > 0){
|
||||
//基础点
|
||||
LatLng baseLatLng = mRoutePoints.get(0);
|
||||
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLon,realLat
|
||||
,baseLatLng.longitude,baseLatLng.latitude);// lon,lat, prelon, prelat
|
||||
if (baseLatLng != null){
|
||||
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLon,realLat
|
||||
,baseLatLng.longitude,baseLatLng.latitude);// lon,lat, prelon, prelat
|
||||
|
||||
for (int i= 1; i < mRoutePoints.size(); i++){
|
||||
LatLng latLng = mRoutePoints.get(i);
|
||||
float diff = CoordinateUtils.calculateLineDistance(realLon,realLat
|
||||
,latLng.longitude,latLng.latitude);
|
||||
if (baseDiffDis > diff){
|
||||
for (int i= 1; i < mRoutePoints.size(); i++){
|
||||
LatLng latLng = mRoutePoints.get(i);
|
||||
float diff = CoordinateUtils.calculateLineDistance(realLon,realLat
|
||||
,latLng.longitude,latLng.latitude);
|
||||
if (baseDiffDis > diff){
|
||||
// Logger.d(M_TAXI + "calculateRouteSumLength", "点:"+i+"-------先记录点----- ");
|
||||
baseDiffDis = diff;
|
||||
currentIndex = i;
|
||||
baseDiffDis = diff;
|
||||
currentIndex = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Logger.d(M_TAXI + "calculateRouteSumLength", "点:"+currentIndex+"-------是最近的点------ ");
|
||||
if (currentIndex == mRoutePoints.size()-1){
|
||||
latePoints.add(mRoutePoints.get(currentIndex));
|
||||
}else {
|
||||
latePoints.addAll(mRoutePoints.subList(currentIndex,mRoutePoints.size()-1));
|
||||
if (currentIndex == mRoutePoints.size()-1){
|
||||
latePoints.add(mRoutePoints.get(currentIndex));
|
||||
}else {
|
||||
latePoints.addAll(mRoutePoints.subList(currentIndex,mRoutePoints.size()-1));
|
||||
}
|
||||
return latePoints;
|
||||
}
|
||||
return latePoints;
|
||||
|
||||
}
|
||||
return latePoints;
|
||||
}
|
||||
@@ -180,20 +183,22 @@ public class CoordinateCalculateRouteUtil {
|
||||
if (mRoutePoints.size() > 0){
|
||||
//基础点
|
||||
LatLng baseLatLng = mRoutePoints.get(0);
|
||||
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLon,realLat
|
||||
,baseLatLng.longitude,baseLatLng.latitude);// lon,lat, prelon, prelat
|
||||
if (baseLatLng != null){
|
||||
float baseDiffDis = CoordinateUtils.calculateLineDistance(realLon,realLat
|
||||
,baseLatLng.longitude,baseLatLng.latitude);// lon,lat, prelon, prelat
|
||||
|
||||
for (int i= 1; i < mRoutePoints.size(); i++){
|
||||
LatLng latLng = mRoutePoints.get(i);
|
||||
float diff = CoordinateUtils.calculateLineDistance(realLon,realLat
|
||||
,latLng.longitude,latLng.latitude);
|
||||
if (baseDiffDis > diff){
|
||||
for (int i= 1; i < mRoutePoints.size(); i++){
|
||||
LatLng latLng = mRoutePoints.get(i);
|
||||
float diff = CoordinateUtils.calculateLineDistance(realLon,realLat
|
||||
,latLng.longitude,latLng.latitude);
|
||||
if (baseDiffDis > diff){
|
||||
// Logger.d(M_TAXI + "calculateRouteSumLength", "点:"+i+"-------先记录点----- ");
|
||||
baseDiffDis = diff;
|
||||
currentIndex = i;
|
||||
baseDiffDis = diff;
|
||||
currentIndex = i;
|
||||
}
|
||||
}
|
||||
return currentIndex;
|
||||
}
|
||||
return currentIndex;
|
||||
}
|
||||
return currentIndex;
|
||||
}
|
||||
|
||||
@@ -156,8 +156,12 @@ public class TaxiNaviFragment extends BaseTaxiUIFragment implements AMapNaviView
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
|
||||
NaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(false);
|
||||
mAMapNaviView.onDestroy();
|
||||
if (mAMapNaviView != null){
|
||||
mAMapNaviView.onDestroy();
|
||||
}
|
||||
|
||||
if (mNaviToStartInfoCallback != null){
|
||||
mNaviToStartInfoCallback = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user