diff options
author | Kirill Zhdanovich <kzhdanovich@gmail.com> | 2013-04-19 13:28:07 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:53:26 +0300 |
commit | 0ff0e2de542e1280239fd7038032179356e4f558 (patch) | |
tree | fd802cf088fc78f03bed6300ce5be4d5439395ea /map/ge0_parser.cpp | |
parent | 74027575af944723b0e330142799d876cb1889fa (diff) |
Checking lat and lon for validity. Rewriting tests.
Diffstat (limited to 'map/ge0_parser.cpp')
-rw-r--r-- | map/ge0_parser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/map/ge0_parser.cpp b/map/ge0_parser.cpp index cbcfb3b4e2..afee35b39d 100644 --- a/map/ge0_parser.cpp +++ b/map/ge0_parser.cpp @@ -3,6 +3,7 @@ #include "../api/internal/c/api-client-internals.h" #include "../coding/url_encode.hpp" #include "../base/math.hpp" +#include "../indexer/mercator.hpp" static const int ZOOM_POSITION = 6; @@ -39,7 +40,10 @@ bool url_api::Ge0Parser::Parse(string const & url, Request & request) request.m_points.push_back(url_api::Point()); url_api::Point & newPt = request.m_points.back(); - DecodeLatLon(url.substr(7,9), newPt.m_lat, newPt.m_lon); + DecodeLatLon(url.substr(7, 9), newPt.m_lat, newPt.m_lon); + + ASSERT(MercatorBounds::ValidLon(newPt.m_lon), (newPt.m_lon)); + ASSERT(MercatorBounds::ValidLat(newPt.m_lat), (newPt.m_lat)); request.m_viewportLat = newPt.m_lat; request.m_viewportLon = newPt.m_lon; |