Big Api Minor Fixes

This commit is contained in:
Kirill Zhdanovich 2013-05-28 13:00:54 +03:00 committed by Alex Zolotarev
parent 90ce047e06
commit 07aeed79ba
4 changed files with 12 additions and 4 deletions

View file

@ -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;
}

View file

@ -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(); }
};

View file

@ -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

View file

@ -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; }