MCPcopy Create free account
hub / github.com/comaps/comaps / OnBuildRouteReady

Method OnBuildRouteReady

libs/map/routing_manager.cpp:421–442  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419}
420
421void 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
444void RoutingManager::OnRebuildRouteReady(Route const & route, RouterResultCode code)
445{

Callers

nothing calls this directly

Calls 6

ASSERTFunction · 0.85
SafeCallMethod · 0.80
GetSubrouteCountMethod · 0.80
IsValidMethod · 0.45
GetLimitRectMethod · 0.45
ScaleMethod · 0.45

Tested by

no test coverage detected