diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-12-08 17:27:07 -0800 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2015-12-09 16:25:45 -0800 |
commit | 896245e510d672eb4c1f8101ba5953c02ad8713c (patch) | |
tree | 567d320ecabef5b9696df6618a182fd1ebd3c850 | |
parent | 50ed524e517787e8637033ea66312dfd199432ae (diff) | |
download | qtlocation-mapboxgl-896245e510d672eb4c1f8101ba5953c02ad8713c.tar.gz |
[test] Update test suite
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | platform/node/src/node_map.cpp | 9 | ||||
-rw-r--r-- | platform/node/test/render.test.js | 5 |
3 files changed, 12 insertions, 4 deletions
diff --git a/package.json b/package.json index 1e47ad4ca3..1be4362732 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ ], "devDependencies": { "aws-sdk": "^2.2.21", - "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#117067ee1789203c46d7648eef8dd49659e62090", + "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#6e2b48155ca651b37826942f2ca082be687b7a42", "node-gyp": "^3.2.1", "request": "^2.67.0", "tape": "^4.2.2" diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp index d9ff63f720..851d5dc889 100644 --- a/platform/node/src/node_map.cpp +++ b/platform/node/src/node_map.cpp @@ -215,9 +215,12 @@ std::unique_ptr<NodeMap::RenderOptions> NodeMap::ParseOptions(v8::Local<v8::Obje } 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->longitude = Nan::Get(center, 0).ToLocalChecked()->NumberValue(); } - if (center->Length() > 1) { options->latitude = Nan::Get(center, 1).ToLocalChecked()->NumberValue(); } + auto centerObj = Nan::Get(obj, Nan::New("center").ToLocalChecked()).ToLocalChecked(); + if (centerObj->IsArray()) { + auto center = centerObj.As<v8::Array>(); + if (center->Length() > 0) { options->longitude = Nan::Get(center, 0).ToLocalChecked()->NumberValue(); } + if (center->Length() > 1) { options->latitude = Nan::Get(center, 1).ToLocalChecked()->NumberValue(); } + } } if (Nan::Has(obj, Nan::New("width").ToLocalChecked()).FromJust()) { diff --git a/platform/node/test/render.test.js b/platform/node/test/render.test.js index 4809019809..a4c6448a16 100644 --- a/platform/node/test/render.test.js +++ b/platform/node/test/render.test.js @@ -31,6 +31,11 @@ suite.run('native', {tests: tests}, function (style, options, callback) { callback(new Error('timed out after 20 seconds')); }, 20000); + options.center = style.center; + options.zoom = style.zoom; + options.bearing = style.bearing; + options.pitch = style.pitch; + map.load(style); map.render(options, function (err, pixels) { map.release(); |