diff --git a/map/traffic_manager.cpp b/map/traffic_manager.cpp index 56a79a8b2..9b0f8a6fb 100644 --- a/map/traffic_manager.cpp +++ b/map/traffic_manager.cpp @@ -756,17 +756,23 @@ void TrafficManager::OnTrafficDataUpdate() /* * Much of this code is copied and pasted together from old MWM code, with some minor adaptations: * - * ForEachActiveMwm and the assertion (not the rest of the body) is from RequestTrafficData(). + * ForEachActiveMwm and the assertion (not the rest of the body) is from RequestTrafficData(); + * modification: cycle over all MWMs (active or not). * trafficCache lookup is original code. - * TrafficInfo construction is taken fron TheadRoutine(), with modifications (different constructor). + * TrafficInfo construction is taken fron ThreadRoutine(), with modifications (different constructor). * Updating m_mwmCache is from RequestTrafficData(MwmSet::MwmId const &, bool), with modifications. * The remainder of the loop is from OnTrafficDataResponse(traffic::TrafficInfo &&), with some modifications - * (deciding whether to notify a component and managing timestamps is original code) + * (deciding whether to notify a component and managing timestamps is original code). + * Existing coloring deletion (if there is no new coloring) is original code. */ - // TODO do this for each MWM, active or not - ForEachActiveMwm([this, notifyDrape, notifyObserver](MwmSet::MwmId const & mwmId) { + ForEachMwm([this, notifyDrape, notifyObserver](std::shared_ptr info) { std::lock_guard lock(m_mutex); + if (info->GetCountryName().starts_with(WORLD_FILE_NAME)) + return; + + MwmSet::MwmId const mwmId(info); + ASSERT(mwmId.IsAlive(), ()); auto tcit = m_allMwmColoring.find(mwmId); if (tcit != m_allMwmColoring.end()) diff --git a/map/traffic_manager.hpp b/map/traffic_manager.hpp index 96acda64b..1ba78b605 100644 --- a/map/traffic_manager.hpp +++ b/map/traffic_manager.hpp @@ -503,6 +503,14 @@ private: void Pause(); void Resume(); + template + void ForEachMwm(F && f) const + { + std::vector> allMwmInfo; + m_dataSource.GetMwmsInfo(allMwmInfo); + std::for_each(allMwmInfo.begin(), allMwmInfo.end(), std::forward(f)); + } + template void ForEachActiveMwm(F && f) const {