| 419 | } |
| 420 | |
| 421 | void RoutingManager::OnBuildRouteReady(Route const & route, RouterResultCode code) |
| 422 | { |
| 423 | // @TODO(bykoianko) Remove |code| from callback signature. |
| 424 | CHECK_EQUAL(code, RouterResultCode::NoError, ()); |
| 425 | HidePreviewSegments(); |
| 426 | |
| 427 | auto const hasWarnings = InsertRoute(route); |
| 428 | m_drapeEngine.SafeCall(&df::DrapeEngine::StopLocationFollow); |
| 429 | |
| 430 | // Validate route (in case of bicycle routing it can be invalid). |
| 431 | ASSERT(route.IsValid(), ()); |
| 432 | // Do not show the full route if one or more stops were added, for easier multi-stop trip planning. |
| 433 | if (route.IsValid() && route.GetSubrouteCount() < 2 && m_currentRouterType != routing::RouterType::Ruler) |
| 434 | { |
| 435 | m2::RectD routeRect = route.GetPoly().GetLimitRect(); |
| 436 | routeRect.Scale(kRouteScaleMultiplier); |
| 437 | m_drapeEngine.SafeCall(&df::DrapeEngine::SetModelViewRect, routeRect, true /* applyRotation */, -1 /* zoom */, |
| 438 | true /* isAnim */, true /* useVisibleViewport */); |
| 439 | } |
| 440 | |
| 441 | CallRouteBuilded(hasWarnings ? RouterResultCode::HasWarnings : code, storage::CountriesSet()); |
| 442 | } |
| 443 | |
| 444 | void RoutingManager::OnRebuildRouteReady(Route const & route, RouterResultCode code) |
| 445 | { |
nothing calls this directly
no test coverage detected