Adds generate_hints=true for dropping hints in response, resolves #1789.

Adds an `generate_hints=false` option which lets us skip generating and
emitting hints for Waypoints. This can be used to decrease the response
size when the user does not need hints anyway.

We should think about making `false` the default here in v6.
This commit is contained in:
Daniel J. Hofmann
2016-12-15 15:28:54 +01:00
parent f04d146ca3
commit b1f6797aab
13 changed files with 83 additions and 22 deletions
+7 -1
View File
@@ -288,11 +288,17 @@ util::json::Object makeRoute(const guidance::Route &route,
return json_route;
}
util::json::Object makeWaypoint(const util::Coordinate location, std::string name, const Hint &hint)
util::json::Object makeWaypoint(const util::Coordinate location, std::string name)
{
util::json::Object waypoint;
waypoint.values["location"] = detail::coordinateToLonLat(location);
waypoint.values["name"] = std::move(name);
return waypoint;
}
util::json::Object makeWaypoint(const util::Coordinate location, std::string name, const Hint &hint)
{
auto waypoint = makeWaypoint(location, name);
waypoint.values["hint"] = hint.ToBase64();
return waypoint;
}