我在此功能结束时调用函数calculateAndDisplayRoute(1)
时遇到问题。我检查了FireFox Developer,发现所有其他代码都正确执行,除了这一行。任何人都可以看到任何问题吗?
function adjustHex(diff, total) {
//....
var nearest = total;
for (var i = 0; i < eightPoints.length; i++) {
for (var j = 0; j < eightPoints.length; j++) {
//....
checkThisHex(tempPoint1, tempPoint2, 2, function (current) {
var bool = compareHex(current, nearest); // returns true if current is closer than the nearest
if (bool == true) {
document.getElementById("printInfo3").innerHTML = current;
nearest = current;
fillWaypts(tempPoint1, tempPoint2);
}
});
}
}
calculateAndDisplayRoute(1);
}