return speed annotations
This commit is contained in:
committed by
Patrick Niklaus
parent
316c7781a3
commit
062cae82a0
@@ -235,6 +235,14 @@ class RouteAPI : public BaseAPI
|
||||
auto &leg_geometry = leg_geometries[idx];
|
||||
util::json::Object annotation;
|
||||
|
||||
if (parameters.annotations_type & RouteParameters::AnnotationsType::Speed)
|
||||
{
|
||||
annotation.values["speed"] = GetAnnotations(
|
||||
leg_geometry, [](const guidance::LegGeometry::Annotation &anno) {
|
||||
return anno.distance / anno.duration;
|
||||
});
|
||||
}
|
||||
|
||||
if (parameters.annotations_type & RouteParameters::AnnotationsType::Duration)
|
||||
{
|
||||
annotation.values["duration"] = GetAnnotations(
|
||||
|
||||
@@ -75,7 +75,8 @@ struct RouteParameters : public BaseParameters
|
||||
Distance = 0x04,
|
||||
Weight = 0x08,
|
||||
Datasources = 0x10,
|
||||
All = Duration | Nodes | Distance | Weight | Datasources
|
||||
Speed = 0x20,
|
||||
All = Duration | Nodes | Distance | Weight | Datasources | Speed
|
||||
};
|
||||
|
||||
RouteParameters() = default;
|
||||
|
||||
Reference in New Issue
Block a user