initial version with updated build system

This commit is contained in:
Konstantin Käfer
2015-02-04 18:21:39 +01:00
commit 07867edd47
20 changed files with 1161 additions and 0 deletions

54
src/node_map.hpp Normal file
View File

@@ -0,0 +1,54 @@
#ifndef NODE_MBGL_NODE_MAP
#define NODE_MBGL_NODE_MAP
#include <mbgl/map/map.hpp>
#include <mbgl/platform/default/headless_view.hpp>
#include <node.h>
#include <nan.h>
#include <queue>
namespace node_mbgl {
class NodeFileSource;
class NodeMap : public node::ObjectWrap {
struct RenderOptions;
class RenderWorker;
////////////////////////////////////////////////////////////////////////////////////////////////
// Static Node Methods
public:
static void Init(v8::Handle<v8::Object> target);
static NAN_METHOD(New);
static NAN_METHOD(Load);
static NAN_METHOD(Render);
static std::unique_ptr<NodeMap::RenderOptions> ParseOptions(v8::Local<v8::Object> obj);
static v8::Persistent<v8::FunctionTemplate> constructorTemplate;
////////////////////////////////////////////////////////////////////////////////////////////////
// Instance
private:
NodeMap(v8::Handle<v8::Object> source);
~NodeMap();
void processNext();
private:
v8::Persistent<v8::Object> source;
v8::Persistent<v8::Object> self;
mbgl::HeadlessView view;
NodeFileSource &fs;
mbgl::Map map;
std::queue<std::unique_ptr<RenderWorker>> queue_;
};
} // end ns node_mbgl
#endif