[core] rotate map on north on routing close

This commit is contained in:
ExMix 2014-10-06 19:16:22 +03:00 committed by Alex Zolotarev
parent 41a04bc8ba
commit f112716093
2 changed files with 11 additions and 2 deletions

View file

@ -306,7 +306,9 @@ void State::StartRouteFollow()
void State::StopRoutingMode()
{
SetModeInfo(ExcludeModeBit(m_modeInfo, RoutingSessionBit));
SetModeInfo(ChangeMode(ExcludeModeBit(m_modeInfo, RoutingSessionBit), Follow));
RotateOnNorth();
AnimateFollow();
}
void State::TurnOff()
@ -783,7 +785,7 @@ void State::AnimateStateTransition(Mode oldMode, Mode newMode)
}
else if (oldMode == RotateAndFollow && newMode == UnknownPosition)
{
m_framework->GetAnimator().RotateScreen(GetModelView().GetAngle(), 0.0);
RotateOnNorth();
}
AnimateFollow();
@ -801,6 +803,11 @@ void State::AnimateFollow()
}
}
void State::RotateOnNorth()
{
m_framework->GetAnimator().RotateScreen(GetModelView().GetAngle(), 0.0);
}
void State::Assign(location::GpsInfo const & info)
{
m2::RectD rect = MercatorBounds::MetresToXY(info.m_longitude,

View file

@ -115,6 +115,8 @@ namespace location
void AnimateStateTransition(Mode oldMode, Mode newMode);
void AnimateFollow();
void RotateOnNorth();
void CallPositionChangedListeners(m2::PointD const & pt);
void CallStateModeListeners();