Adapt to feedback in #519
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
namespace osrm
|
||||
{
|
||||
@@ -32,7 +33,19 @@ struct BaseParameters
|
||||
{
|
||||
return (hints.empty() || hints.size() == coordinates.size()) &&
|
||||
(bearings.empty() || bearings.size() == coordinates.size()) &&
|
||||
(radiuses.empty() || radiuses.size() == coordinates.size());
|
||||
(radiuses.empty() || radiuses.size() == coordinates.size()) &&
|
||||
std::all_of(bearings.begin(), bearings.end(),
|
||||
[](const boost::optional<Bearing> bearing_and_range)
|
||||
{
|
||||
if (bearing_and_range)
|
||||
{
|
||||
return bearing_and_range->bearing >= 0 &&
|
||||
bearing_and_range->bearing <= 360 &&
|
||||
bearing_and_range->range >= 0 &&
|
||||
bearing_and_range->range <= 180;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ util::json::Object makeRoute(const guidance::Route &route,
|
||||
boost::optional<util::json::Value> geometry);
|
||||
|
||||
util::json::Object
|
||||
makeWaypoint(const FixedPointCoordinate location, std::string &&way_name, const Hint &hint);
|
||||
makeWaypoint(const FixedPointCoordinate location, std::string &&name, const Hint &hint);
|
||||
|
||||
util::json::Object makeRouteLeg(guidance::RouteLeg &&leg, util::json::Array &&steps);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user