Fix annotations=true handling in NodeJS bindings & libosrm (#6415)

This commit is contained in:
Siarhei Fedartsou
2022-10-19 08:35:18 +02:00
committed by GitHub
parent d65e8c7d1e
commit fb1bb7a15b
5 changed files with 20 additions and 7 deletions
+6
View File
@@ -799,6 +799,9 @@ inline bool parseCommonParameters(const v8::Local<v8::Object> &obj, ParamType &p
if (annotations->IsBoolean())
{
params->annotations = Nan::To<bool>(annotations).FromJust();
params->annotations_type = params->annotations
? osrm::RouteParameters::AnnotationsType::All
: osrm::RouteParameters::AnnotationsType::None;
}
else if (annotations->IsArray())
{
@@ -845,6 +848,9 @@ inline bool parseCommonParameters(const v8::Local<v8::Object> &obj, ParamType &p
Nan::ThrowError("this 'annotations' param is not supported");
return false;
}
params->annotations =
params->annotations_type != osrm::RouteParameters::AnnotationsType::None;
}
}
else