Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of github.com:mapnik/node-mapnik

  • Loading branch information...
commit bc67fbc0a4ea7d54f153145ec90087753a5f8827 2 parents b9f7ac3 + f6f7bf1
@springmeyer springmeyer authored
Showing with 9 additions and 0 deletions.
  1. +8 −0 src/mapnik_map.cpp
  2. +1 −0  src/mapnik_map.hpp
View
8 src/mapnik_map.cpp
@@ -92,6 +92,7 @@ void Map::Initialize(Handle<Object> target) {
NODE_SET_PROTOTYPE_METHOD(constructor, "zoomAll", zoomAll);
NODE_SET_PROTOTYPE_METHOD(constructor, "zoomToBox", zoomToBox); //setExtent
+ NODE_SET_PROTOTYPE_METHOD(constructor, "scale", scale);
NODE_SET_PROTOTYPE_METHOD(constructor, "scaleDenominator", scaleDenominator);
NODE_SET_PROTOTYPE_METHOD(constructor, "queryPoint", queryPoint);
NODE_SET_PROTOTYPE_METHOD(constructor, "queryMapPoint", queryMapPoint);
@@ -459,6 +460,13 @@ void Map::set_prop(Local<String> property,
}
}
+Handle<Value> Map::scale(const Arguments& args)
+{
+ HandleScope scope;
+ Map* m = ObjectWrap::Unwrap<Map>(args.This());
+ return scope.Close(Number::New(m->map_->scale()));
+}
+
Handle<Value> Map::scaleDenominator(const Arguments& args)
{
HandleScope scope;
View
1  src/mapnik_map.hpp
@@ -57,6 +57,7 @@ class Map: public node::ObjectWrap {
static Handle<Value> zoomAll(const Arguments &args);
static Handle<Value> zoomToBox(const Arguments &args);
static Handle<Value> layers(const Arguments &args);
+ static Handle<Value> scale(const Arguments &args);
static Handle<Value> scaleDenominator(const Arguments &args);
static Handle<Value> queryPoint(const Arguments &args);
static Handle<Value> queryMapPoint(const Arguments &args);
Please sign in to comment.
Something went wrong with that request. Please try again.