怎么才能将已经路过的点隐藏呢 ==

因为存在路径重新规划的情况,所以不能留着尾巴(也没必要啊)
现在的做法是数点算距离,判断离哪个点最近,但这样的话在掉头或者转弯的时候很容易出错(正好有一个点在旁边就当成 false 了)
double lastPointDistance = 0;
int increaseTimes = 0;
int minValueIndex = 0;
boolean canfindTheNearestPoint = false;
for (int i = 0; i < routeArray.size(); i++) {
if (distance(i) > lastPointDistance) {
increaseTimes++;
} else {
increaseTimes = 0;
minValueIndex = i;
}
if (increaseTimes >= 3) {
canfindTheNearestPoint = true;
break;
}
lastPointDistance = distance;
}
if (canfindTheNearestPoint == YES) {
DrawlineFromIndex(minValueIndex + 1);
TruncateCoordinatesArrayFromIndex(minValueIndex);
}
有什么建议吗(*  ̄︿ ̄)
