From e8f2f39b4f15281b03914659457adcabf1f88b4a Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Tue, 31 May 2011 21:07:18 +0200 Subject: [PATCH] [search] Match (lat, lon). --- search/query.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/search/query.cpp b/search/query.cpp index bb39ac3a97..3ea08f010d 100644 --- a/search/query.cpp +++ b/search/query.cpp @@ -1,8 +1,10 @@ #include "query.hpp" #include "delimiters.hpp" #include "keyword_matcher.hpp" +#include "latlon_match.hpp" #include "string_match.hpp" #include "../indexer/feature_visibility.hpp" +#include "../indexer/mercator.hpp" #include "../base/stl_add.hpp" namespace search @@ -87,6 +89,18 @@ struct FeatureProcessor void Query::Search(function const & f) { + // Lat lon match + { + double lat, lon; + if (search::MatchLatLon(m_queryText, lat, lon)) + { + double const x = MercatorBounds::LonToX(lon); + double const y = MercatorBounds::LatToY(lat); + f(Result("(" + strings::to_string(lat) + ", " + strings::to_string(lon) + ")", + m2::RectD(x - 0.1, y - 0.1, x + 0.1, y + 0.1))); + } + } + FeatureProcessor featureProcessor(*this); int const scale = scales::GetScaleLevel(m_rect) + 1; if (scale > scales::GetUpperWorldScale())