Distance was not summed up correctly
This commit is contained in:
parent
d2b6ac722b
commit
0a29df80d0
@ -163,7 +163,9 @@ public:
|
|||||||
omitted++;
|
omitted++;
|
||||||
}
|
}
|
||||||
if(nextID == nameID) {
|
if(nextID == nameID) {
|
||||||
tempDist += ApproximateDistance(previous.lat, previous.lon, current.lat, current.lon);
|
double _dist = ApproximateDistance(previous.lat, previous.lon, current.lat, current.lon);
|
||||||
|
tempDist += _dist;
|
||||||
|
entireDistance += _dist;
|
||||||
} else {
|
} else {
|
||||||
if(type == 0 && prevType != 0)
|
if(type == 0 && prevType != 0)
|
||||||
routeInstructionString += ",enter motorway and ";
|
routeInstructionString += ",enter motorway and ";
|
||||||
@ -173,8 +175,9 @@ public:
|
|||||||
if(nameID != 0)
|
if(nameID != 0)
|
||||||
routeInstructionString += sEngine->GetEscapedNameForNameID(nameID);
|
routeInstructionString += sEngine->GetEscapedNameForNameID(nameID);
|
||||||
routeInstructionString += "\",";
|
routeInstructionString += "\",";
|
||||||
distanceOfInstruction += ApproximateDistance(previous.lat, previous.lon, current.lat, current.lon)+tempDist;
|
double _dist = ApproximateDistance(previous.lat, previous.lon, current.lat, current.lon);
|
||||||
entireDistance += distanceOfInstruction;
|
distanceOfInstruction += _dist + tempDist;
|
||||||
|
entireDistance += _dist;
|
||||||
intNumberString.str("");
|
intNumberString.str("");
|
||||||
intNumberString << 10*(round(distanceOfInstruction/10.));;
|
intNumberString << 10*(round(distanceOfInstruction/10.));;
|
||||||
routeInstructionString += intNumberString.str();
|
routeInstructionString += intNumberString.str();
|
||||||
@ -223,6 +226,7 @@ public:
|
|||||||
lastAngle = angle;
|
lastAngle = angle;
|
||||||
tempDist = 0;
|
tempDist = 0;
|
||||||
prevType = type;
|
prevType = type;
|
||||||
|
distanceOfInstruction = 0;
|
||||||
durationOfInstruction = 0;
|
durationOfInstruction = 0;
|
||||||
}
|
}
|
||||||
nameID = nextID;
|
nameID = nextID;
|
||||||
|
Loading…
Reference in New Issue
Block a user