Add avoid parameter to the API

This commit is contained in:
Patrick Niklaus
2017-07-20 23:54:26 +00:00
committed by Patrick Niklaus
parent 9c11197768
commit 58061a68c4
3 changed files with 43 additions and 2 deletions
+18 -1
View File
@@ -81,6 +81,23 @@ struct RouteParameters : public BaseParameters
RouteParameters() = default;
template <typename... Args>
RouteParameters(const bool steps_,
const bool alternatives_,
const GeometriesType geometries_,
const OverviewType overview_,
const boost::optional<bool> continue_straight_,
std::vector<std::string> avoid_,
Args... args_)
: BaseParameters{std::forward<Args>(args_)...}, steps{steps_}, alternatives{alternatives_},
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{false},
annotations_type{AnnotationsType::None}, geometries{geometries_}, overview{overview_},
continue_straight{continue_straight_}, avoid{std::move(avoid_)}
// Once we perfectly-forward `args` (see #2990) this constructor can delegate to the one below.
{
}
// Without avoid flags
template <typename... Args>
RouteParameters(const bool steps_,
const bool alternatives_,
@@ -92,7 +109,6 @@ struct RouteParameters : public BaseParameters
number_of_alternatives{alternatives_ ? 1u : 0u}, annotations{false},
annotations_type{AnnotationsType::None}, geometries{geometries_}, overview{overview_},
continue_straight{continue_straight_}
// Once we perfectly-forward `args` (see #2990) this constructor can delegate to the one below.
{
}
@@ -138,6 +154,7 @@ struct RouteParameters : public BaseParameters
GeometriesType geometries = GeometriesType::Polyline;
OverviewType overview = OverviewType::Simplified;
boost::optional<bool> continue_straight;
std::vector<std::string> avoid;
bool IsValid() const
{