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

Method SetUserCurrentPosition

libs/map/routing_manager.cpp:1182–1201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1180}
1181
1182void RoutingManager::SetUserCurrentPosition(m2::PointD const & position)
1183{
1184 m_routingSession.PushPositionAccumulator(position);
1185
1186 if (IsRoutingActive())
1187 m_routingSession.SetUserCurrentPosition(position);
1188
1189 if (m_routeRecommendCallback != nullptr)
1190 {
1191 // Check if we've found my position almost immediately after route points loading.
1192 auto constexpr kFoundLocationInterval = 2.0;
1193 auto const elapsed = chrono::steady_clock::now() - m_loadRoutePointsTimestamp;
1194 auto const sec = chrono::duration_cast<chrono::duration<double>>(elapsed).count();
1195 if (sec <= kFoundLocationInterval)
1196 {
1197 m_routeRecommendCallback(Recommendation::RebuildAfterPointsLoading);
1198 CancelRecommendation(Recommendation::RebuildAfterPointsLoading);
1199 }
1200 }
1201}
1202
1203static std::string GetNameFromPoint(RouteMarkData const & rmd)
1204{

Callers 2

BuildRouteMethod · 0.45
OnUserPositionChangedMethod · 0.45

Calls 2

countMethod · 0.45

Tested by

no test coverage detected