forked from organicmaps/organicmaps
Sorting turn candidates by angle to make workable LeftmostDirection() RightmostDirection() mehtods.
This commit is contained in:
parent
043b9ba387
commit
53e008f79c
1 changed files with 4 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
|||
#include "geometry/mercator.hpp"
|
||||
#include "geometry/point2d.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <numeric>
|
||||
#include <utility>
|
||||
|
@ -281,6 +282,9 @@ void BicycleDirectionsEngine::GetSegmentRangeAndAdjacentEdges(
|
|||
}
|
||||
outgoingTurns.candidates.emplace_back(angle, ConvertEdgeToSegment(*m_numMwmIds, edge), highwayClass);
|
||||
}
|
||||
|
||||
if (outgoingTurns.isCandidatesAngleValid)
|
||||
sort(outgoingTurns.candidates.begin(), outgoingTurns.candidates.end(), my::LessBy(&TurnCandidate::angle));
|
||||
}
|
||||
|
||||
void BicycleDirectionsEngine::GetEdges(RoadGraphBase const & graph, Junction const & currJunction,
|
||||
|
|
Loading…
Add table
Reference in a new issue