forked from organicmaps/organicmaps
[search] Fixed wrong units in a call to IsEqualMercator.
SearchAPITest_MultipleViewportsRequests waited indefinitely on a future-promise because of a wrong eps in IsEqualMercator.
This commit is contained in:
parent
335c44894c
commit
0e3c861315
1 changed files with 3 additions and 2 deletions
|
@ -34,6 +34,7 @@ namespace
|
|||
using BookmarkIdDoc = pair<bookmarks::Id, bookmarks::Doc>;
|
||||
|
||||
double const kDistEqualQueryMeters = 100.0;
|
||||
double const kDistEqualQueryMercator = MercatorBounds::MetersToMercator(kDistEqualQueryMeters);
|
||||
|
||||
// Cancels search query by |handle|.
|
||||
void CancelQuery(weak_ptr<ProcessorHandle> & handle)
|
||||
|
@ -407,14 +408,14 @@ bool SearchAPI::QueryMayBeSkipped(SearchParams const & prevParams,
|
|||
return false;
|
||||
|
||||
if (!prevViewport.IsValid() ||
|
||||
!IsEqualMercator(prevViewport, currViewport, kDistEqualQueryMeters))
|
||||
!IsEqualMercator(prevViewport, currViewport, kDistEqualQueryMercator))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (prevParams.m_position && currParams.m_position &&
|
||||
MercatorBounds::DistanceOnEarth(*prevParams.m_position, *currParams.m_position) >
|
||||
kDistEqualQueryMeters)
|
||||
kDistEqualQueryMercator)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue