summaryrefslogtreecommitdiff
path: root/platform/node
diff options
context:
space:
mode:
authorbsudekum <bobby@mapbox.com>2015-11-02 15:54:29 -0800
committerbsudekum <bobby@mapbox.com>2015-11-02 16:58:24 -0800
commit93c5bc08b358f8959f82f5f364b3de58ebbe67c9 (patch)
tree999804d0d2691864d629bef77f287e533b5eb0d4 /platform/node
parent9067fd43f3936a9827d0d54cee70a90359920818 (diff)
downloadqtlocation-mapboxgl-93c5bc08b358f8959f82f5f364b3de58ebbe67c9.tar.gz
[node] add pitch option
Diffstat (limited to 'platform/node')
-rw-r--r--platform/node/src/node_map.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp
index e36f9bc222..c47eae3614 100644
--- a/platform/node/src/node_map.cpp
+++ b/platform/node/src/node_map.cpp
@@ -17,6 +17,7 @@ namespace node_mbgl {
struct NodeMap::RenderOptions {
double zoom = 0;
double bearing = 0;
+ double pitch = 0;
double latitude = 0;
double longitude = 0;
unsigned int width = 512;
@@ -204,6 +205,10 @@ std::unique_ptr<NodeMap::RenderOptions> NodeMap::ParseOptions(v8::Local<v8::Obje
options->bearing = Nan::Get(obj, Nan::New("bearing").ToLocalChecked()).ToLocalChecked()->NumberValue();
}
+ if (Nan::Has(obj, Nan::New("pitch").ToLocalChecked()).FromJust()) {
+ options->pitch = Nan::Get(obj, Nan::New("pitch").ToLocalChecked()).ToLocalChecked()->NumberValue();
+ }
+
if (Nan::Has(obj, Nan::New("center").ToLocalChecked()).FromJust()) {
auto center = Nan::Get(obj, Nan::New("center").ToLocalChecked()).ToLocalChecked().As<v8::Array>();
if (center->Length() > 0) { options->latitude = Nan::Get(center, 0).ToLocalChecked()->NumberValue(); }
@@ -288,6 +293,7 @@ void NodeMap::startRender(std::unique_ptr<NodeMap::RenderOptions> options) {
map->setClasses(options->classes);
map->setLatLngZoom(mbgl::LatLng(options->latitude, options->longitude), options->zoom);
map->setBearing(options->bearing);
+ map->setPitch(options->pitch);
map->renderStill([this](const std::exception_ptr eptr, std::unique_ptr<const mbgl::StillImage> result) {
if (eptr) {