diff options
author | Kirill Zhdanovich <kzhdanovich@gmail.com> | 2013-06-21 13:45:32 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:57:13 +0300 |
commit | 79a43ef9414ec4fa85417a72ad0366729736dbcc (patch) | |
tree | a1a5a9c42394aa65d91f777fad570ee6807de097 /map | |
parent | 2a34b742e4e59fb192b8ec607a805ac51d3623cc (diff) |
Generate api url for iOS if there is NO point bakUrl
Diffstat (limited to 'map')
-rw-r--r-- | map/framework.cpp | 12 | ||||
-rw-r--r-- | map/framework.hpp | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/map/framework.cpp b/map/framework.cpp index a78645cf59..05635ffb5f 100644 --- a/map/framework.cpp +++ b/map/framework.cpp @@ -378,7 +378,6 @@ void Framework::LoadBookmarks() { if (!GetPlatform().IsPro()) return; - m_bmManager.LoadBookmarks(); } @@ -1665,3 +1664,14 @@ bool Framework::GetMapApiPoint(m2::PointD const & pxPoint, url_scheme::ApiPoint } return result; } + +string Framework::GenerateApiBackUrl(url_scheme::ApiPoint const & point) +{ + string res = GetMapApiBackUrl(); + if (!res.empty() && res[res.size() -1] != '/') + res += '/'; + res += "map?ll=" + strings::to_string(point.m_lat) + "," + strings::to_string(point.m_lon); + if (!point.m_name.empty()) + res += "&n=" + point.m_name; + return res; +} diff --git a/map/framework.hpp b/map/framework.hpp index af4d711c1e..f7459ca657 100644 --- a/map/framework.hpp +++ b/map/framework.hpp @@ -13,7 +13,6 @@ #include "bookmark_manager.hpp" #include "balloon_manager.hpp" -#include "url_api.hpp" #include "mwm_url.hpp" #include "../defines.hpp" @@ -464,4 +463,5 @@ public: string const & GetMapApiBackUrl() const { return m_ParsedMapApi.GetGlobalBackUrl(); } m2::RectD GetMapApiLatLonRect() const { return m_ParsedMapApi.GetLatLonRect(); } bool IsValidMapApi() const { return m_ParsedMapApi.IsValid(); } + string GenerateApiBackUrl(url_scheme::ApiPoint const & point); }; |