opt draw line
This commit is contained in:
@@ -158,27 +158,44 @@ public class MogoRouteOverlayManager implements
|
||||
|
||||
@Override
|
||||
public void onLocationChanged(@Nullable MogoLocation location) { //todo 拖尾
|
||||
// mLocation = location;
|
||||
// if (mTrajectoryList.isEmpty()) {
|
||||
// return;
|
||||
// }
|
||||
// Log.d(TAG, "onLocationChanged : " + mTrajectoryList.size());
|
||||
// ArrayList list = new ArrayList();
|
||||
// for (MogoLatLng latLng : mTrajectoryList) {
|
||||
// if (!isPointOnCarFront(mLocation, latLng)) {
|
||||
// list.add(latLng);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// StringBuilder builder = new StringBuilder();
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// MogoLatLng latLng = (MogoLatLng) list.get(i);
|
||||
// builder.append(latLng.getLon()).append(",");
|
||||
// builder.append(latLng.getLat()).append(",");
|
||||
// }
|
||||
// Log.d(TAG, "onLocationChanged : " + GsonUtils.toJson(builder.toString()));
|
||||
// Log.d(TAG,"onLocationChanged size = " + list.size() + "---TrajectoryData = " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + "----" + STATUS_AUTOPILOT);
|
||||
// if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || STATUS_AUTOPILOT == 1) {
|
||||
// RouteOverlayDrawer.getInstance(mContext).drawTrajectoryList(list);
|
||||
// }
|
||||
|
||||
mLocation = location;
|
||||
if (mTrajectoryList.isEmpty()) {
|
||||
List<MogoLatLng> temp = mTrajectoryList;
|
||||
if (temp.isEmpty()){
|
||||
return;
|
||||
}
|
||||
Log.d(TAG, "onLocationChanged : " + mTrajectoryList.size());
|
||||
ArrayList list = new ArrayList();
|
||||
for (MogoLatLng latLng : mTrajectoryList) {
|
||||
if (!isPointOnCarFront(mLocation, latLng)) {
|
||||
Log.e(TAG, "onLocationChanged: size = "+ mTrajectoryList.size()+" ----- "+mLocation.getLongitude()+"-"+mLocation.getLatitude());
|
||||
ArrayList list = new ArrayList();
|
||||
for (MogoLatLng latLng:temp) {
|
||||
if(!isPointOnCarFront(mLocation,latLng)){
|
||||
list.add(latLng);
|
||||
}
|
||||
}
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
MogoLatLng latLng = (MogoLatLng) list.get(i);
|
||||
builder.append(latLng.getLon()).append(",");
|
||||
builder.append(latLng.getLat()).append(",");
|
||||
}
|
||||
Log.d(TAG, "onLocationChanged : " + GsonUtils.toJson(builder.toString()));
|
||||
Log.d(TAG,"onLocationChanged size = " + list.size() + "---TrajectoryData = " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + "----" + STATUS_AUTOPILOT);
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || STATUS_AUTOPILOT == 1) {
|
||||
Log.d(TAG,"TrajectoryData = " + FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData + "---status = " + STATUS_AUTOPILOT + "----size = " + list.size());
|
||||
if (FunctionBuildConfig.isIgnoreConditionsDrawAutopilotTrajectoryData || STATUS_AUTOPILOT == 1){
|
||||
RouteOverlayDrawer.getInstance(mContext).drawTrajectoryList(list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class RouteOverlayDrawer {
|
||||
long drawstart = System.currentTimeMillis();
|
||||
|
||||
mPolylinePointList.clear();
|
||||
if (routeList != null) {
|
||||
if (routeList != null && routeList.size() > 0) {
|
||||
for (MogoLatLng latLng : routeList) {
|
||||
mPolylinePointList.add(latLng);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user