forked from organicmaps/organicmaps
Merge pull request #3786 from ygorshenin/fix-nasty-search-bugs
[search] Fixed nasty search bugs.
This commit is contained in:
commit
775690d1dd
3 changed files with 8 additions and 5 deletions
|
@ -408,7 +408,7 @@ void Processor::Search(SearchParams const & params, m2::RectD const & viewport)
|
|||
Geocoder::Params geocoderParams;
|
||||
InitGeocoder(geocoderParams);
|
||||
|
||||
InitPreRanker();
|
||||
InitPreRanker(geocoderParams);
|
||||
InitRanker();
|
||||
|
||||
try
|
||||
|
@ -681,11 +681,12 @@ void Processor::InitGeocoder(Geocoder::Params & params)
|
|||
m_geocoder.SetParams(params);
|
||||
}
|
||||
|
||||
void Processor::InitPreRanker()
|
||||
void Processor::InitPreRanker(Geocoder::Params const & geocoderParams)
|
||||
{
|
||||
PreRanker::Params params;
|
||||
|
||||
params.m_accuratePivotCenter = GetPivotPoint();
|
||||
params.m_scale = geocoderParams.m_scale;
|
||||
m_preRanker.Init(params);
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
|
||||
void InitParams(QueryParams & params);
|
||||
void InitGeocoder(Geocoder::Params & params);
|
||||
void InitPreRanker();
|
||||
void InitPreRanker(Geocoder::Params const & geocoderParams);
|
||||
void InitRanker();
|
||||
|
||||
void ClearCaches();
|
||||
|
|
|
@ -311,11 +311,13 @@ void Ranker::MakePreResult2(Geocoder::Params const & geocoderParams, vector<Inde
|
|||
{
|
||||
auto p = maker(r);
|
||||
if (!p)
|
||||
return;
|
||||
continue;
|
||||
|
||||
if (geocoderParams.m_mode == Mode::Viewport &&
|
||||
!geocoderParams.m_pivot.IsPointInside(p->GetCenter()))
|
||||
return;
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (p->IsStreet())
|
||||
streets.push_back(p->GetID());
|
||||
|
|
Loading…
Add table
Reference in a new issue