Limit tile zoomlevel to 12+
This commit is contained in:
parent
6d749777fc
commit
0eaa393065
@ -92,9 +92,9 @@ struct RouteParameters
|
|||||||
|
|
||||||
void SetCoordinatesFromGeometry(const std::string &geometry_string);
|
void SetCoordinatesFromGeometry(const std::string &geometry_string);
|
||||||
|
|
||||||
void SetX(const int &x);
|
bool SetX(const int x);
|
||||||
void SetZ(const int &z);
|
bool SetZ(const int z);
|
||||||
void SetY(const int &y);
|
bool SetY(const int y);
|
||||||
|
|
||||||
short zoom_level;
|
short zoom_level;
|
||||||
bool print_instructions;
|
bool print_instructions;
|
||||||
|
@ -16,6 +16,18 @@ template <typename Iterator, class HandlerT> struct APIGrammar : qi::grammar<Ite
|
|||||||
{
|
{
|
||||||
explicit APIGrammar(HandlerT *h) : APIGrammar::base_type(api_call), handler(h)
|
explicit APIGrammar(HandlerT *h) : APIGrammar::base_type(api_call), handler(h)
|
||||||
{
|
{
|
||||||
|
const auto set_x_wrapper = [this](const int x, bool &pass)
|
||||||
|
{
|
||||||
|
pass = handler->SetX(x);
|
||||||
|
};
|
||||||
|
const auto set_y_wrapper = [this](const int y, bool &pass)
|
||||||
|
{
|
||||||
|
pass = handler->SetY(y);
|
||||||
|
};
|
||||||
|
const auto set_z_wrapper = [this](const int z, bool &pass)
|
||||||
|
{
|
||||||
|
pass = handler->SetZ(z);
|
||||||
|
};
|
||||||
const auto add_bearing_wrapper = [this](
|
const auto add_bearing_wrapper = [this](
|
||||||
const boost::fusion::vector<int, boost::optional<int>> &received_bearing, bool &pass)
|
const boost::fusion::vector<int, boost::optional<int>> &received_bearing, bool &pass)
|
||||||
{
|
{
|
||||||
@ -110,12 +122,12 @@ template <typename Iterator, class HandlerT> struct APIGrammar : qi::grammar<Ite
|
|||||||
locs = (-qi::lit('&')) >> qi::lit("locs") >> '=' >>
|
locs = (-qi::lit('&')) >> qi::lit("locs") >> '=' >>
|
||||||
stringforPolyline[boost::bind(&HandlerT::SetCoordinatesFromGeometry, handler, ::_1)];
|
stringforPolyline[boost::bind(&HandlerT::SetCoordinatesFromGeometry, handler, ::_1)];
|
||||||
|
|
||||||
z = (-qi::lit('&')) >> qi::lit("tz") >> '=' >>
|
|
||||||
qi::int_[boost::bind(&HandlerT::SetZ, handler, ::_1)];
|
|
||||||
x = (-qi::lit('&')) >> qi::lit("tx") >> '=' >>
|
x = (-qi::lit('&')) >> qi::lit("tx") >> '=' >>
|
||||||
qi::int_[boost::bind(&HandlerT::SetX, handler, ::_1)];
|
qi::int_[boost::bind<void>(set_x_wrapper, ::_1, ::_3)];
|
||||||
y = (-qi::lit('&')) >> qi::lit("ty") >> '=' >>
|
y = (-qi::lit('&')) >> qi::lit("ty") >> '=' >>
|
||||||
qi::int_[boost::bind(&HandlerT::SetY, handler, ::_1)];
|
qi::int_[boost::bind<void>(set_y_wrapper, ::_1, ::_3)];
|
||||||
|
z = (-qi::lit('&')) >> qi::lit("tz") >> '=' >>
|
||||||
|
qi::int_[boost::bind<void>(set_z_wrapper, ::_1, ::_3)];
|
||||||
|
|
||||||
string = +(qi::char_("a-zA-Z"));
|
string = +(qi::char_("a-zA-Z"));
|
||||||
stringwithDot = +(qi::char_("a-zA-Z0-9_.-"));
|
stringwithDot = +(qi::char_("a-zA-Z0-9_.-"));
|
||||||
|
@ -144,8 +144,25 @@ void RouteParameters::SetCoordinatesFromGeometry(const std::string &geometry_str
|
|||||||
coordinates = polylineDecode(geometry_string);
|
coordinates = polylineDecode(geometry_string);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RouteParameters::SetX(const int &x_) { x = x_; }
|
bool RouteParameters::SetX(const int x_)
|
||||||
void RouteParameters::SetZ(const int &z_) { z = z_; }
|
{
|
||||||
void RouteParameters::SetY(const int &y_) { y = y_; }
|
x = x_;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool RouteParameters::SetZ(const int z_)
|
||||||
|
{
|
||||||
|
if (z_ < 12)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
z = z_;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
bool RouteParameters::SetY(const int y_)
|
||||||
|
{
|
||||||
|
y = y_;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user