diff options
author | Alex Zolotarev <alex@maps.me> | 2016-01-09 11:47:55 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:04:25 +0300 |
commit | 90754ca5da7ee24b1fbd47cacb00e789c5c1a2bf (patch) | |
tree | 71441efe774d73df0fdd1241446ff8544b175577 /editor/server_api.cpp | |
parent | 68cce571003376ad67bc60d78f885e64c338a3bd (diff) |
ServerApi returns response directly.
Diffstat (limited to 'editor/server_api.cpp')
-rw-r--r-- | editor/server_api.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/editor/server_api.cpp b/editor/server_api.cpp index 891156e5fc..10d04192df 100644 --- a/editor/server_api.cpp +++ b/editor/server_api.cpp @@ -100,7 +100,7 @@ OsmOAuth::ResponseCode ServerApi06::TestUserExists(string const & userName) return m_auth.DirectRequest(method, false).first; } -string ServerApi06::GetXmlFeaturesInRect(m2::RectD const & latLonRect) const +OsmOAuth::Response ServerApi06::GetXmlFeaturesInRect(m2::RectD const & latLonRect) const { using strings::to_string_dac; @@ -111,19 +111,14 @@ string ServerApi06::GetXmlFeaturesInRect(m2::RectD const & latLonRect) const string const url = "/map?bbox=" + to_string_dac(lb.x, kDAC) + ',' + to_string_dac(lb.y, kDAC) + ',' + to_string_dac(rt.x, kDAC) + ',' + to_string_dac(rt.y, kDAC); - OsmOAuth::Response const response = m_auth.DirectRequest(url); - if (response.first == OsmOAuth::ResponseCode::OK) - return response.second; - - LOG(LWARNING, ("GetXmlFeaturesInRect request has failed:", response.first)); - return string(); + return m_auth.DirectRequest(url); } -string ServerApi06::GetXmlNodeByLatLon(double lat, double lon) const +OsmOAuth::Response ServerApi06::GetXmlNodeByLatLon(double lat, double lon) const { - constexpr double const kInflateRadiusDegrees = 1.0e-6; //!< ~1 meter. + double const kInflateEpsilon = MercatorBounds::GetCellID2PointAbsEpsilon(); m2::RectD rect(lon, lat, lon, lat); - rect.Inflate(kInflateRadiusDegrees, kInflateRadiusDegrees); + rect.Inflate(kInflateEpsilon, kInflateEpsilon); return GetXmlFeaturesInRect(rect); } |