Blob Blame History Raw
commit e722bd94838a534dd4367b6dc4bb0476be4bf87a
Author: Dane Springmeyer <dane@mapbox.com>
Date:   Wed Jan 14 18:03:01 2015 -0800

    fix compile with nan 1.5.0 (but stick with 1.4.1 for now)

diff --git a/src/js_grid_utils.hpp b/src/js_grid_utils.hpp
index 4062bf1..beb83d6 100644
--- a/src/js_grid_utils.hpp
+++ b/src/js_grid_utils.hpp
@@ -135,7 +135,7 @@ static void write_features(T const& grid_type,
         {
             if (attr == "__id__")
             {
-                feat->Set(NanNew(attr.c_str()), NanNew<Integer>(feature->id()));
+                feat->Set(NanNew(attr.c_str()), NanNew<Number>(feature->id()));
             }
             else if (feature->has_key(attr))
             {
diff --git a/src/mapnik_color.cpp b/src/mapnik_color.cpp
index 08ef804..7b799be 100644
--- a/src/mapnik_color.cpp
+++ b/src/mapnik_color.cpp
@@ -113,7 +113,7 @@ NAN_METHOD(Color::New)
     NanReturnUndefined();
 }
 
-Handle<Value> Color::New(mapnik::color const& color) {
+Handle<Value> Color::NewInstance(mapnik::color const& color) {
     NanEscapableScope();
     Color* c = new Color();
     c->this_ = MAPNIK_MAKE_SHARED<mapnik::color>(color);
diff --git a/src/mapnik_color.hpp b/src/mapnik_color.hpp
index a012f8f..6933466 100644
--- a/src/mapnik_color.hpp
+++ b/src/mapnik_color.hpp
@@ -17,7 +17,7 @@ public:
     static Persistent<FunctionTemplate> constructor;
     static void Initialize(Handle<Object> target);
     static NAN_METHOD(New);
-    static Handle<Value> New(mapnik::color const& color);
+    static Handle<Value> NewInstance(mapnik::color const& color);
     static NAN_METHOD(toString);
     static NAN_METHOD(hex);
 
diff --git a/src/mapnik_datasource.cpp b/src/mapnik_datasource.cpp
index e9fb4eb..d8ca7bd 100644
--- a/src/mapnik_datasource.cpp
+++ b/src/mapnik_datasource.cpp
@@ -142,7 +142,7 @@ NAN_METHOD(Datasource::New)
     NanReturnUndefined();
 }
 
-Handle<Value> Datasource::New(mapnik::datasource_ptr ds_ptr) {
+Handle<Value> Datasource::NewInstance(mapnik::datasource_ptr ds_ptr) {
     NanEscapableScope();
     Datasource* d = new Datasource();
     d->datasource_ = ds_ptr;
@@ -238,7 +238,7 @@ NAN_METHOD(Datasource::featureset)
 
     if (fs)
     {
-        NanReturnValue(Featureset::New(fs));
+        NanReturnValue(Featureset::NewInstance(fs));
     }
 
     NanReturnUndefined();
diff --git a/src/mapnik_datasource.hpp b/src/mapnik_datasource.hpp
index d211a3e..db85de9 100644
--- a/src/mapnik_datasource.hpp
+++ b/src/mapnik_datasource.hpp
@@ -17,7 +17,7 @@ public:
     static Persistent<FunctionTemplate> constructor;
     static void Initialize(Handle<Object> target);
     static NAN_METHOD(New);
-    static Handle<Value> New(datasource_ptr ds_ptr);
+    static Handle<Value> NewInstance(datasource_ptr ds_ptr);
 
     static NAN_METHOD(parameters);
     static NAN_METHOD(describe);
diff --git a/src/mapnik_feature.cpp b/src/mapnik_feature.cpp
index 4bafeed..aef9915 100644
--- a/src/mapnik_feature.cpp
+++ b/src/mapnik_feature.cpp
@@ -100,7 +100,7 @@ NAN_METHOD(Feature::New)
     NanReturnValue(args.This());
 }
 
-Handle<Value> Feature::New(mapnik::feature_ptr f_ptr)
+Handle<Value> Feature::NewInstance(mapnik::feature_ptr f_ptr)
 {
     NanEscapableScope();
     Feature* f = new Feature(f_ptr);
diff --git a/src/mapnik_feature.hpp b/src/mapnik_feature.hpp
index c6ada1c..8a1bfb8 100644
--- a/src/mapnik_feature.hpp
+++ b/src/mapnik_feature.hpp
@@ -19,7 +19,7 @@ public:
     static Persistent<FunctionTemplate> constructor;
     static void Initialize(Handle<Object> target);
     static NAN_METHOD(New);
-    static Handle<Value> New(mapnik::feature_ptr f_ptr);
+    static Handle<Value> NewInstance(mapnik::feature_ptr f_ptr);
     static NAN_METHOD(id);
     static NAN_METHOD(extent);
     static NAN_METHOD(attributes);
diff --git a/src/mapnik_featureset.cpp b/src/mapnik_featureset.cpp
index 96c33ae..79f2262 100644
--- a/src/mapnik_featureset.cpp
+++ b/src/mapnik_featureset.cpp
@@ -68,13 +68,13 @@ NAN_METHOD(Featureset::next)
         }
 
         if (fp) {
-            NanReturnValue(Feature::New(fp));
+            NanReturnValue(Feature::NewInstance(fp));
         }
     }
     NanReturnUndefined();
 }
 
-Handle<Value> Featureset::New(mapnik::featureset_ptr fs_ptr)
+Handle<Value> Featureset::NewInstance(mapnik::featureset_ptr fs_ptr)
 {
     NanEscapableScope();
     Featureset* fs = new Featureset();
diff --git a/src/mapnik_featureset.hpp b/src/mapnik_featureset.hpp
index aa6fa09..cc852b6 100644
--- a/src/mapnik_featureset.hpp
+++ b/src/mapnik_featureset.hpp
@@ -14,7 +14,7 @@ public:
     static Persistent<FunctionTemplate> constructor;
     static void Initialize(Handle<Object> target);
     static NAN_METHOD(New);
-    static Handle<Value> New(mapnik::featureset_ptr fs_ptr);
+    static Handle<Value> NewInstance(mapnik::featureset_ptr fs_ptr);
     static NAN_METHOD(next);
 
     Featureset();
diff --git a/src/mapnik_grid.cpp b/src/mapnik_grid.cpp
index 79b3214..d6e135b 100644
--- a/src/mapnik_grid.cpp
+++ b/src/mapnik_grid.cpp
@@ -298,7 +298,7 @@ NAN_METHOD(Grid::view)
     unsigned h = args[3]->IntegerValue();
 
     Grid* g = node::ObjectWrap::Unwrap<Grid>(args.Holder());
-    NanReturnValue(GridView::New(g,x,y,w,h));
+    NanReturnValue(GridView::NewInstance(g,x,y,w,h));
 }
 
 NAN_METHOD(Grid::encodeSync) // format, resolution
@@ -389,7 +389,7 @@ NAN_METHOD(Grid::encodeSync) // format, resolution
         for (unsigned j=0;j<lines.size();++j)
         {
             node_mapnik::grid_line_type const & line = lines[j];
-            grid_array->Set(j, NanNew(line.get(),array_size));
+            grid_array->Set(j, NanNew<String>(line.get(),array_size));
         }
         json->Set(NanNew("grid"), grid_array);
         json->Set(NanNew("keys"), keys_a);
@@ -550,7 +550,7 @@ void Grid::EIO_AfterEncode(uv_work_t* req)
         for (unsigned j=0;j<closure->lines.size();++j)
         {
             node_mapnik::grid_line_type const & line = closure->lines[j];
-            grid_array->Set(j, NanNew(line.get(),array_size));
+            grid_array->Set(j, NanNew<String>(line.get(),array_size));
         }
         json->Set(NanNew("grid"), grid_array);
         json->Set(NanNew("keys"), keys_a);
diff --git a/src/mapnik_grid_view.cpp b/src/mapnik_grid_view.cpp
index d1bee14..e55a4b7 100644
--- a/src/mapnik_grid_view.cpp
+++ b/src/mapnik_grid_view.cpp
@@ -74,7 +74,7 @@ NAN_METHOD(GridView::New)
     NanReturnUndefined();
 }
 
-Handle<Value> GridView::New(Grid * JSGrid,
+Handle<Value> GridView::NewInstance(Grid * JSGrid,
                             unsigned x,
                             unsigned y,
                             unsigned w,
@@ -349,7 +349,7 @@ NAN_METHOD(GridView::encodeSync)
         for (unsigned j=0;j<lines.size();++j)
         {
             node_mapnik::grid_line_type const & line = lines[j];
-            grid_array->Set(j, NanNew(line.get(),array_size));
+            grid_array->Set(j, NanNew<String>(line.get(),array_size));
         }
         json->Set(NanNew("grid"), grid_array);
         json->Set(NanNew("keys"), keys_a);
@@ -512,7 +512,7 @@ void GridView::EIO_AfterEncode(uv_work_t* req)
         for (unsigned j=0;j<closure->lines.size();++j)
         {
             node_mapnik::grid_line_type const & line = closure->lines[j];
-            grid_array->Set(j, NanNew(line.get(),array_size));
+            grid_array->Set(j, NanNew<String>(line.get(),array_size));
         }
         json->Set(NanNew("grid"), grid_array);
         json->Set(NanNew("keys"), keys_a);
diff --git a/src/mapnik_grid_view.hpp b/src/mapnik_grid_view.hpp
index 1667cc4..df31cb0 100644
--- a/src/mapnik_grid_view.hpp
+++ b/src/mapnik_grid_view.hpp
@@ -16,7 +16,7 @@ public:
     static Persistent<FunctionTemplate> constructor;
     static void Initialize(Handle<Object> target);
     static NAN_METHOD(New);
-    static Handle<Value> New(Grid * JSGrid,
+    static Handle<Value> NewInstance(Grid * JSGrid,
                              unsigned x,unsigned y, unsigned w, unsigned h);
 
     static NAN_METHOD(encodeSync);
diff --git a/src/mapnik_image.cpp b/src/mapnik_image.cpp
index ec5a9fc..58dc1bd 100644
--- a/src/mapnik_image.cpp
+++ b/src/mapnik_image.cpp
@@ -153,7 +153,7 @@ NAN_GETTER(Image::get_prop)
     if (a == "background") {
         boost::optional<mapnik::color> c = im->get()->get_background();
         if (c) {
-            NanReturnValue(Color::New(*c));
+            NanReturnValue(Color::NewInstance(*c));
         } else {
             NanReturnUndefined();
         }
@@ -213,7 +213,7 @@ NAN_METHOD(Image::getPixel)
         unsigned g = (pixel >> 8) & 0xff;
         unsigned b = (pixel >> 16) & 0xff;
         unsigned a = (pixel >> 24) & 0xff;
-        NanReturnValue(Color::New(mapnik::color(r,g,b,a)));
+        NanReturnValue(Color::NewInstance(mapnik::color(r,g,b,a)));
     }
     NanReturnUndefined();
 }
@@ -1108,7 +1108,7 @@ NAN_METHOD(Image::view)
     unsigned h = args[3]->IntegerValue();
 
     Image* im = node::ObjectWrap::Unwrap<Image>(args.Holder());
-    NanReturnValue(ImageView::New(im,x,y,w,h));
+    NanReturnValue(ImageView::NewInstance(im,x,y,w,h));
 }
 
 NAN_METHOD(Image::save)
diff --git a/src/mapnik_image_view.cpp b/src/mapnik_image_view.cpp
index 8010dda..cb1b91a 100644
--- a/src/mapnik_image_view.cpp
+++ b/src/mapnik_image_view.cpp
@@ -76,7 +76,7 @@ NAN_METHOD(ImageView::New)
     NanReturnUndefined();
 }
 
-Handle<Value> ImageView::New(Image * JSImage ,
+Handle<Value> ImageView::NewInstance(Image * JSImage ,
                              unsigned x,
                              unsigned y,
                              unsigned w,
@@ -253,7 +253,7 @@ NAN_METHOD(ImageView::getPixel)
         unsigned g = (pixel >> 8) & 0xff;
         unsigned b = (pixel >> 16) & 0xff;
         unsigned a = (pixel >> 24) & 0xff;
-        NanReturnValue(Color::New(mapnik::color(r,g,b,a)));
+        NanReturnValue(Color::NewInstance(mapnik::color(r,g,b,a)));
     }
     NanReturnUndefined();
 }
diff --git a/src/mapnik_image_view.hpp b/src/mapnik_image_view.hpp
index 9d9fbdc..bfbf76d 100644
--- a/src/mapnik_image_view.hpp
+++ b/src/mapnik_image_view.hpp
@@ -17,7 +17,7 @@ public:
     static Persistent<FunctionTemplate> constructor;
     static void Initialize(Handle<Object> target);
     static NAN_METHOD(New);
-    static Handle<Value> New(Image * JSImage,
+    static Handle<Value> NewInstance(Image * JSImage,
                              unsigned x,unsigned y, unsigned w, unsigned h);
 
     static NAN_METHOD(encodeSync);
diff --git a/src/mapnik_layer.cpp b/src/mapnik_layer.cpp
index b2a3b35..8fc1de1 100644
--- a/src/mapnik_layer.cpp
+++ b/src/mapnik_layer.cpp
@@ -114,7 +114,7 @@ NAN_METHOD(Layer::New)
     NanReturnValue(args.This());
 }
 
-Handle<Value> Layer::New(mapnik::layer const& lay_ref) {
+Handle<Value> Layer::NewInstance(mapnik::layer const& lay_ref) {
     NanEscapableScope();
     Layer* l = new Layer();
     // copy new mapnik::layer into the shared_ptr
@@ -146,7 +146,7 @@ NAN_GETTER(Layer::get_prop)
         mapnik::datasource_ptr ds = l->layer_->datasource();
         if (ds)
         {
-            NanReturnValue(Datasource::New(ds));
+            NanReturnValue(Datasource::NewInstance(ds));
         }
     }
     NanReturnUndefined();
diff --git a/src/mapnik_layer.hpp b/src/mapnik_layer.hpp
index 4af932d..b34249c 100644
--- a/src/mapnik_layer.hpp
+++ b/src/mapnik_layer.hpp
@@ -20,7 +20,7 @@ public:
     static void Initialize(Handle<Object> target);
     static NAN_METHOD(New);
 
-    static Handle<Value> New(mapnik::layer const& lay_ref);
+    static Handle<Value> NewInstance(mapnik::layer const& lay_ref);
     static NAN_METHOD(describe);
 
     static NAN_GETTER(get_prop);
diff --git a/src/mapnik_map.cpp b/src/mapnik_map.cpp
index 2b87413..1e321fa 100644
--- a/src/mapnik_map.cpp
+++ b/src/mapnik_map.cpp
@@ -254,7 +254,7 @@ NAN_GETTER(Map::get_prop)
     else if (a == "background") {
         boost::optional<mapnik::color> c = m->map_->background();
         if (c)
-            NanReturnValue(Color::New(*c));
+            NanReturnValue(Color::NewInstance(*c));
         else
             NanReturnUndefined();
     }
@@ -647,7 +647,7 @@ void Map::EIO_AfterQueryMap(uv_work_t* req)
             {
                 Local<Object> obj = NanNew<Object>();
                 obj->Set(NanNew("layer"), NanNew(it->first.c_str()));
-                obj->Set(NanNew("featureset"), Featureset::New(it->second));
+                obj->Set(NanNew("featureset"), Featureset::NewInstance(it->second));
                 a->Set(idx, obj);
                 ++idx;
             }
@@ -675,7 +675,7 @@ NAN_METHOD(Map::layers)
     Local<Array> a = NanNew<Array>(layers.size());
     for (unsigned i = 0; i < layers.size(); ++i )
     {
-        a->Set(i, Layer::New(layers[i]));
+        a->Set(i, Layer::NewInstance(layers[i]));
     }
     NanReturnValue(a);
 }
@@ -718,7 +718,7 @@ NAN_METHOD(Map::get_layer)
 
         if (index < layers.size())
         {
-            NanReturnValue(Layer::New(layers[index]));
+            NanReturnValue(Layer::NewInstance(layers[index]));
         }
         else
         {
@@ -736,7 +736,7 @@ NAN_METHOD(Map::get_layer)
             if (lyr.name() == layer_name)
             {
                 found = true;
-                NanReturnValue(Layer::New(layers[idx]));
+                NanReturnValue(Layer::NewInstance(layers[idx]));
             }
             ++idx;
         }
diff --git a/src/mapnik_memory_datasource.cpp b/src/mapnik_memory_datasource.cpp
index 404b0d6..3390bbb 100644
--- a/src/mapnik_memory_datasource.cpp
+++ b/src/mapnik_memory_datasource.cpp
@@ -105,7 +105,7 @@ NAN_METHOD(MemoryDatasource::New)
     NanReturnValue(args.This());
 }
 
-Handle<Value> MemoryDatasource::New(mapnik::datasource_ptr ds_ptr) {
+Handle<Value> MemoryDatasource::NewInstance(mapnik::datasource_ptr ds_ptr) {
     NanEscapableScope();
     MemoryDatasource* d = new MemoryDatasource();
     d->datasource_ = ds_ptr;
@@ -172,7 +172,7 @@ NAN_METHOD(MemoryDatasource::featureset)
             mapnik::featureset_ptr fs = d->datasource_->features(q);
             if (fs)
             {
-                NanReturnValue(Featureset::New(fs));
+                NanReturnValue(Featureset::NewInstance(fs));
             }
         }
     }
diff --git a/src/mapnik_memory_datasource.hpp b/src/mapnik_memory_datasource.hpp
index bec4146..e535957 100644
--- a/src/mapnik_memory_datasource.hpp
+++ b/src/mapnik_memory_datasource.hpp
@@ -13,7 +13,7 @@ public:
     static Persistent<FunctionTemplate> constructor;
     static void Initialize(Handle<Object> target);
     static NAN_METHOD(New);
-    static Handle<Value> New(mapnik::datasource_ptr ds_ptr);
+    static Handle<Value> NewInstance(mapnik::datasource_ptr ds_ptr);
     static NAN_METHOD(parameters);
     static NAN_METHOD(describe);
     static NAN_METHOD(features);
diff --git a/src/mapnik_vector_tile.cpp b/src/mapnik_vector_tile.cpp
index ff68cb7..64979df 100644
--- a/src/mapnik_vector_tile.cpp
+++ b/src/mapnik_vector_tile.cpp
@@ -981,7 +981,7 @@ Local<Array> VectorTile::_queryResultToV8(std::vector<query_result> const& resul
 {
     Local<Array> arr = NanNew<Array>();
     for (std::size_t i = 0; i < result.size(); ++i) {
-        Handle<Value> feat = Feature::New(result[i].feature);
+        Handle<Value> feat = Feature::NewInstance(result[i].feature);
         Local<Object> feat_obj = feat->ToObject();
         feat_obj->Set(NanNew("layer"),NanNew(result[i].layer.c_str()));
         feat_obj->Set(NanNew("distance"),NanNew<Number>(result[i].distance));
@@ -1281,7 +1281,7 @@ Local<Object> VectorTile::_queryManyResultToV8(queryMany_result const& result) {
     // result.features => features
     typedef std::map<unsigned,query_result>::const_iterator features_it_type;
     for (features_it_type it = result.features.begin(); it != result.features.end(); it++) {
-        Handle<Value> feat = Feature::New(it->second.feature);
+        Handle<Value> feat = Feature::NewInstance(it->second.feature);
         Local<Object> feat_obj = feat->ToObject();
         feat_obj->Set(NanNew("layer"),NanNew(it->second.layer.c_str()));
         features->Set(it->first, feat_obj);