forked from organicmaps/organicmaps
Big Api Minor Fixes
This commit is contained in:
parent
90ce047e06
commit
07aeed79ba
4 changed files with 12 additions and 4 deletions
|
@ -1452,7 +1452,14 @@ bool Framework::SetViewportByURL(string const & url, url_api::Request & request)
|
|||
}
|
||||
else if (strings::StartsWith(url, "mapswithme://") || strings::StartsWith(url, "mwm://"))
|
||||
{
|
||||
m_ParsedMapApi.SetUriAndParse(url);
|
||||
if (m_ParsedMapApi.SetUriAndParse(url))
|
||||
{
|
||||
m2::RectD z = GetMapApiRect();
|
||||
//Can do better consider nav bar size
|
||||
m2::RectD view(MercatorBounds::LonToX(z.minX()), MercatorBounds::LatToY(z.minY()),
|
||||
MercatorBounds::LonToX(z.maxX()), MercatorBounds::LatToY(z.maxY()));
|
||||
ShowRectExVisibleScale(view);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -466,4 +466,5 @@ public:
|
|||
string const & GetMapApiAppTitle() const { return m_ParsedMapApi.GetAppTitle(); }
|
||||
string const & GetMapApiBackUrl() const { return m_ParsedMapApi.GetGlobalBackUrl(); }
|
||||
m2::RectD GetMapApiRect() const { return m_ParsedMapApi.GetRect(); }
|
||||
bool IsValidMapApi() const { return m_ParsedMapApi.IsValid(); }
|
||||
};
|
||||
|
|
|
@ -32,10 +32,10 @@ ParsedMapApi::ParsedMapApi(Uri const & uri):m_id(0)
|
|||
}
|
||||
}
|
||||
|
||||
void ParsedMapApi::SetUriAndParse(string const & url)
|
||||
bool ParsedMapApi::SetUriAndParse(string const & url)
|
||||
{
|
||||
Clear();
|
||||
Parse(url_scheme::Uri(url));
|
||||
return Parse(url_scheme::Uri(url));
|
||||
}
|
||||
|
||||
bool ParsedMapApi::IsValid() const
|
||||
|
|
|
@ -20,7 +20,7 @@ class ParsedMapApi
|
|||
public:
|
||||
ParsedMapApi(Uri const & uri);
|
||||
ParsedMapApi();
|
||||
void SetUriAndParse(string const & url);
|
||||
bool SetUriAndParse(string const & url);
|
||||
bool IsValid() const;
|
||||
vector<ApiPoint> const & GetPoints() const { return m_points; }
|
||||
string const & GetGlobalBackUrl() const { return m_globalBackUrl; }
|
||||
|
|
Loading…
Add table
Reference in a new issue