| 91 | } |
| 92 | |
| 93 | void RoutingSession::RebuildRoute(m2::PointD const & startPoint, ReadyCallback const & readyCallback, |
| 94 | NeedMoreMapsCallback const & needMoreMapsCallback, |
| 95 | RemoveRouteCallback const & removeRouteCallback, uint32_t timeoutSec, |
| 96 | SessionState routeRebuildingState, bool adjustToPrevRoute) |
| 97 | { |
| 98 | CHECK_THREAD_CHECKER(m_threadChecker, ()); |
| 99 | CHECK(m_router, ()); |
| 100 | SetState(routeRebuildingState); |
| 101 | |
| 102 | ++m_routingRebuildCount; |
| 103 | auto const & direction = |
| 104 | m_routingSettings.m_useDirectionForRouteBuilding ? m_positionAccumulator.GetDirection() : m2::PointD::Zero(); |
| 105 | |
| 106 | Checkpoints checkpoints(m_checkpoints); |
| 107 | checkpoints.SetPointFrom(startPoint); |
| 108 | // Use old-style callback construction, because lambda constructs buggy function on Android |
| 109 | // (callback param isn't captured by value). |
| 110 | m_router->CalculateRoute(checkpoints, direction, adjustToPrevRoute, DoReadyCallback(*this, readyCallback), |
| 111 | needMoreMapsCallback, removeRouteCallback, m_progressCallback, timeoutSec); |
| 112 | } |
| 113 | |
| 114 | m2::PointD RoutingSession::GetStartPoint() const |
| 115 | { |