forked from organicmaps/organicmaps
Stop location follow when showing search result or bookmark. Do it in common Framework code.
This commit is contained in:
parent
9af9076daf
commit
566b6b74ff
3 changed files with 15 additions and 6 deletions
|
@ -407,12 +407,6 @@ namespace android
|
|||
{
|
||||
m_doLoadState = false;
|
||||
|
||||
shared_ptr<location::State> ls = m_work.GetInformationDisplay().locationState();
|
||||
|
||||
ls->StopCompassFollowing();
|
||||
ls->SetLocationProcessMode(location::ELocationDoNothing);
|
||||
ls->SetIsCentered(false);
|
||||
|
||||
m_work.ShowSearchResult(r);
|
||||
}
|
||||
|
||||
|
|
|
@ -116,6 +116,15 @@ void Framework::OnCompassUpdate(location::CompassInfo const & info)
|
|||
m_informationDisplay.locationState()->OnCompassUpdate(rInfo);
|
||||
}
|
||||
|
||||
void Framework::StopLocationFollow()
|
||||
{
|
||||
shared_ptr<location::State> ls = m_informationDisplay.locationState();
|
||||
|
||||
ls->StopCompassFollowing();
|
||||
ls->SetLocationProcessMode(location::ELocationDoNothing);
|
||||
ls->SetIsCentered(false);
|
||||
}
|
||||
|
||||
InformationDisplay & Framework::GetInformationDisplay()
|
||||
{
|
||||
return m_informationDisplay;
|
||||
|
@ -477,6 +486,8 @@ BookmarkAndCategory Framework::GetBookmark(m2::PointD const & pxPoint, double vi
|
|||
|
||||
void Framework::ShowBookmark(Bookmark const & bm)
|
||||
{
|
||||
StopLocationFollow();
|
||||
|
||||
double scale = bm.GetScale();
|
||||
if (scale == -1.0) scale = 16.0;
|
||||
|
||||
|
@ -1169,6 +1180,8 @@ bool Framework::GetCurrentPosition(double & lat, double & lon) const
|
|||
|
||||
void Framework::ShowSearchResult(search::Result const & res)
|
||||
{
|
||||
StopLocationFollow();
|
||||
|
||||
m2::RectD const rect = res.GetFeatureRect();
|
||||
|
||||
ShowRectExVisibleScale(rect);
|
||||
|
|
|
@ -110,6 +110,8 @@ protected:
|
|||
location::ECompassProcessMode m_dragCompassProcessMode;
|
||||
location::ELocationProcessMode m_dragLocationProcessMode;
|
||||
|
||||
void StopLocationFollow();
|
||||
|
||||
//mutable threads::Mutex m_modelSyn;
|
||||
|
||||
storage::Storage m_storage;
|
||||
|
|
Loading…
Add table
Reference in a new issue