forked from organicmaps/organicmaps
Do additional search according to search mode.
This commit is contained in:
parent
a8f49d2d39
commit
614e13677e
3 changed files with 8 additions and 5 deletions
|
@ -293,7 +293,9 @@ void Engine::SearchAsync()
|
|||
{
|
||||
try
|
||||
{
|
||||
m_pQuery->SearchAdditional(res);
|
||||
m_pQuery->SearchAdditional(res,
|
||||
params.NeedSearch(SearchParams::AROUND_POSITION),
|
||||
params.NeedSearch(SearchParams::IN_VIEWPORT));
|
||||
}
|
||||
catch (Query::CancelException const &)
|
||||
{
|
||||
|
|
|
@ -1623,18 +1623,19 @@ void Query::SearchAllInViewport(m2::RectD const & viewport, Results & res, unsig
|
|||
}
|
||||
}
|
||||
|
||||
void Query::SearchAdditional(Results & res)
|
||||
void Query::SearchAdditional(Results & res, bool nearMe, bool inViewport)
|
||||
{
|
||||
ClearQueues();
|
||||
|
||||
string name[2];
|
||||
|
||||
// search in mwm with position ...
|
||||
if (m_position.x > empty_pos_value && m_position.y > empty_pos_value)
|
||||
if (nearMe && m_position.x > empty_pos_value && m_position.y > empty_pos_value)
|
||||
name[0] = m_pInfoGetter->GetRegionFile(m_position);
|
||||
|
||||
// ... and in mwm with viewport
|
||||
name[1] = m_pInfoGetter->GetRegionFile(GetViewport().Center());
|
||||
if (inViewport)
|
||||
name[1] = m_pInfoGetter->GetRegionFile(GetViewport().Center());
|
||||
|
||||
LOG(LDEBUG, ("Additional MWM search: ", name[0], name[1]));
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
void SearchCoordinates(string const & query, Results & res) const;
|
||||
void Search(Results & res);
|
||||
void SearchAllInViewport(m2::RectD const & viewport, Results & res, unsigned int resultsNeeded = 30);
|
||||
void SearchAdditional(Results & res);
|
||||
void SearchAdditional(Results & res, bool nearMe, bool inViewport);
|
||||
//@}
|
||||
|
||||
void ClearCaches();
|
||||
|
|
Loading…
Add table
Reference in a new issue