#pragma once #include #include #include #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" #pragma GCC diagnostic ignored "-Wshadow" #include #pragma GCC diagnostic pop namespace node_mbgl { class NodeMap : public Nan::ObjectWrap, public mbgl::FileSource { public: struct RenderOptions; class RenderWorker; NodeMap(v8::Local); ~NodeMap(); static Nan::Persistent constructor; static NAN_MODULE_INIT(Init); static void New(const Nan::FunctionCallbackInfo&); static void Load(const Nan::FunctionCallbackInfo&); static void Loaded(const Nan::FunctionCallbackInfo&); static void Render(const Nan::FunctionCallbackInfo&); static void Release(const Nan::FunctionCallbackInfo&); static void AddClass(const Nan::FunctionCallbackInfo&); static void AddSource(const Nan::FunctionCallbackInfo&); static void AddLayer(const Nan::FunctionCallbackInfo&); static void RemoveLayer(const Nan::FunctionCallbackInfo&); static void SetLayoutProperty(const Nan::FunctionCallbackInfo&); static void SetPaintProperty(const Nan::FunctionCallbackInfo&); static void SetFilter(const Nan::FunctionCallbackInfo&); static void DumpDebugLogs(const Nan::FunctionCallbackInfo&); static void QueryRenderedFeatures(const Nan::FunctionCallbackInfo&); void startRender(RenderOptions options); void renderFinished(); void release(); static RenderOptions ParseOptions(v8::Local); std::unique_ptr request(const mbgl::Resource&, mbgl::FileSource::Callback); mbgl::HeadlessView view; std::unique_ptr map; std::exception_ptr error; mbgl::PremultipliedImage image; std::unique_ptr callback; // Async for delivering the notifications of render completion. uv_async_t *async; bool loaded = false; }; }