Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/search
diff options
context:
space:
mode:
authorvng <viktor.govako@gmail.com>2013-01-10 15:30:15 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:48:29 +0300
commit98e75d8202c4f0bb853038bcbf25ca8142d220bf (patch)
tree283a78cb7115f1be2e8691bf0a753298c02b552e /search
parent420b73044d6b69427dc6ef4303575cd6df7cb50d (diff)
Do better check for distance on earth.
Diffstat (limited to 'search')
-rw-r--r--search/search_engine.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/search/search_engine.cpp b/search/search_engine.cpp
index 9757b85157..3807311c7a 100644
--- a/search/search_engine.cpp
+++ b/search/search_engine.cpp
@@ -110,7 +110,6 @@ namespace
// X metres in mercator (lon, lat) units.
double const epsEqualRects = 100.0 * MercatorBounds::degreeInMetres;
- double const epsEqualPoints = 500.0 * MercatorBounds::degreeInMetres;
/// Check rects for optimal search (avoid duplicating).
void AnalyzeRects(m2::RectD arrRects[2])
@@ -153,10 +152,8 @@ bool Engine::Search(SearchParams const & params, m2::RectD const & viewport)
if (!m_params.IsValidPosition())
return false;
- m2::PointD const p1 = GetViewportXY(m_params.m_lat, m_params.m_lon);
- m2::PointD const p2 = GetViewportXY(params.m_lat, params.m_lon);
-
- if (p1.EqualDxDy(p2, epsEqualPoints))
+ // Check distance between previous and current user's position.
+ if (ms::DistanceOnEarth(m_params.m_lat, m_params.m_lon, params.m_lat, params.m_lon) < 500.0)
return false;
}