clang-format off * The `OSRM` method is the main constructor for creating an OSRM instance. * An OSRM instance requires a `.osrm.*` dataset(`.osrm.*` because it contains several files), which is prepared by the OSRM toolchain. * You can create such a `.osrm.*` dataset by running the OSRM binaries we ship in `node_modules/osrm/lib/binding_napi_v8/` and default * profiles (e.g. for setting speeds
| 84 | */ |
| 85 | // clang-format on |
| 86 | Engine::Engine(const Napi::CallbackInfo &info) : Napi::ObjectWrap<Engine>(info) |
| 87 | { |
| 88 | |
| 89 | try |
| 90 | { |
| 91 | auto config = argumentsToEngineConfig(info); |
| 92 | if (!config) |
| 93 | return; |
| 94 | |
| 95 | this_ = std::make_shared<osrm::OSRM>(*config); |
| 96 | } |
| 97 | catch (const std::exception &ex) |
| 98 | { |
| 99 | ThrowTypeError(info.Env(), ex.what()); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | template <typename ParameterParser, typename ServiceMemFn> |
| 104 | inline void async(const Napi::CallbackInfo &info, |
nothing calls this directly
no test coverage detected