Nan 2.0
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-parameter"
|
||||
#pragma GCC diagnostic ignored "-Wshadow"
|
||||
#include <node.h>
|
||||
#include <nan.h>
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
@@ -16,14 +15,13 @@
|
||||
|
||||
namespace node_mbgl {
|
||||
|
||||
class NodeMap : public node::ObjectWrap {
|
||||
class NodeMap : public Nan::ObjectWrap {
|
||||
public:
|
||||
struct RenderOptions;
|
||||
class RenderWorker;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Static Node Methods
|
||||
public:
|
||||
static void Init(v8::Handle<v8::Object> target);
|
||||
static NAN_MODULE_INIT(Init);
|
||||
|
||||
static NAN_METHOD(New);
|
||||
static NAN_METHOD(Load);
|
||||
static NAN_METHOD(Render);
|
||||
@@ -37,24 +35,20 @@ public:
|
||||
inline bool isLoaded() { return loaded; }
|
||||
inline bool isValid() { return valid; }
|
||||
|
||||
static std::unique_ptr<NodeMap::RenderOptions> ParseOptions(v8::Local<v8::Object> obj);
|
||||
static std::unique_ptr<NodeMap::RenderOptions> ParseOptions(v8::Local<v8::Object>);
|
||||
static Nan::Persistent<v8::Function> constructor;
|
||||
|
||||
static v8::Persistent<v8::FunctionTemplate> constructorTemplate;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Instance
|
||||
private:
|
||||
NodeMap(v8::Handle<v8::Object>);
|
||||
NodeMap(v8::Local<v8::Object>);
|
||||
~NodeMap();
|
||||
|
||||
private:
|
||||
mbgl::HeadlessView view;
|
||||
NodeFileSource fs;
|
||||
std::unique_ptr<mbgl::Map> map;
|
||||
|
||||
std::exception_ptr error;
|
||||
std::unique_ptr<const mbgl::StillImage> image;
|
||||
std::unique_ptr<NanCallback> callback;
|
||||
std::unique_ptr<Nan::Callback> callback;
|
||||
|
||||
// Async for delivering the notifications of render completion.
|
||||
uv_async_t *async;
|
||||
|
||||
Reference in New Issue
Block a user