#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 #include namespace node_mbgl { class NodeMap : public Nan::ObjectWrap, public mbgl::FileSource { public: struct RenderOptions; class RenderWorker; static NAN_MODULE_INIT(Init); static NAN_METHOD(New); static NAN_METHOD(Load); static NAN_METHOD(Render); static NAN_METHOD(Release); static NAN_METHOD(DumpDebugLogs); void startRender(RenderOptions options); void renderFinished(); void release(); inline bool isLoaded() { return loaded; } inline bool isValid() { return valid; } static RenderOptions ParseOptions(v8::Local); static Nan::Persistent constructor; NodeMap(v8::Local); ~NodeMap(); std::unique_ptr request(const mbgl::Resource&, 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; bool valid = true; }; }