[eye][isolines] mark isolines layer as used

This commit is contained in:
Arsentiy Milchakov 2020-02-04 15:48:46 +03:00 committed by Daria Volvenkova
parent b3eb78dee1
commit be5cf0bb83
2 changed files with 11 additions and 0 deletions

View file

@ -2,6 +2,8 @@
#include "indexer/isolines_info.hpp"
#include "metrics/eye.hpp"
#include "drape_frontend/drape_engine.hpp"
#include "drape_frontend/visual_params.hpp"
@ -43,6 +45,7 @@ void IsolinesManager::SetEnabled(bool enabled)
{
ChangeState(enabled ? IsolinesState::Enabled : IsolinesState::Disabled);
m_drapeEngine.SafeCall(&df::DrapeEngine::EnableIsolines, enabled);
m_trackFirstSchemeData = enabled;
if (enabled)
{
Invalidate();
@ -127,7 +130,14 @@ void IsolinesManager::UpdateState()
else if (!available && noData)
ChangeState(IsolinesState::NoData);
else
{
if (available && m_trackFirstSchemeData)
{
eye::Eye::Event::LayerShown(eye::Layer::Type::Isolines);
m_trackFirstSchemeData = false;
}
ChangeState(IsolinesState::Enabled);
}
}
void IsolinesManager::Invalidate()

View file

@ -67,6 +67,7 @@ private:
std::vector<MwmSet::MwmId> m_lastMwms;
std::map<MwmSet::MwmId, Availability> m_mwmCache;
bool m_trackFirstSchemeData = false;
};
std::string DebugPrint(IsolinesManager::IsolinesState state);