summaryrefslogtreecommitdiff
path: root/platform/node/src
diff options
context:
space:
mode:
authorChris Loer <chris.loer@gmail.com>2018-09-06 14:58:37 -0700
committerChris Loer <chris.loer@mapbox.com>2018-09-12 14:10:46 -0700
commitd735d89835fb3076e09594fce2a141fe1495e33f (patch)
tree36fb80484b3952fb730fd34a77439d303d002cdc /platform/node/src
parent079ba0209ed383c15123902f0810e658c2b0abf4 (diff)
downloadqtlocation-mapboxgl-d735d89835fb3076e09594fce2a141fe1495e33f.tar.gz
[core] Port "collision group" plumbing to gl-native.
[node] Hook up map-wide "crossSourceCollisions" option, defaulting to true. [test] Pass "crossSourceCollisions" test option through test harness; enable cross-source-collisions tests on native.
Diffstat (limited to 'platform/node/src')
-rw-r--r--platform/node/src/node_map.cpp18
-rw-r--r--platform/node/src/node_map.hpp1
2 files changed, 17 insertions, 2 deletions
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp
index 7dbccfcf41..e32c576e14 100644
--- a/platform/node/src/node_map.cpp
+++ b/platform/node/src/node_map.cpp
@@ -621,7 +621,10 @@ void NodeMap::cancel() {
frontend = std::make_unique<mbgl::HeadlessFrontend>(mbgl::Size{ 256, 256 }, pixelRatio, *this, threadpool);
map = std::make_unique<mbgl::Map>(*frontend, mapObserver, frontend->getSize(), pixelRatio,
- *this, threadpool, mode);
+ *this, threadpool, mode,
+ mbgl::ConstrainMode::HeightOnly,
+ mbgl::ViewportMode::Default,
+ crossSourceCollisions);
// FIXME: Reload the style after recreating the map. We need to find
// a better way of canceling an ongoing rendering on the core level
@@ -1212,6 +1215,14 @@ NodeMap::NodeMap(v8::Local<v8::Object> options)
return mbgl::MapMode::Static;
}
}())
+ , crossSourceCollisions([&] {
+ Nan::HandleScope scope;
+ return Nan::Has(options, Nan::New("crossSourceCollisions").ToLocalChecked()).FromJust()
+ ? Nan::Get(options, Nan::New("crossSourceCollisions").ToLocalChecked())
+ .ToLocalChecked()
+ ->BooleanValue()
+ : true;
+ }())
, mapObserver(NodeMapObserver())
, frontend(std::make_unique<mbgl::HeadlessFrontend>(mbgl::Size { 256, 256 }, pixelRatio, *this, threadpool))
, map(std::make_unique<mbgl::Map>(*frontend,
@@ -1220,7 +1231,10 @@ NodeMap::NodeMap(v8::Local<v8::Object> options)
pixelRatio,
*this,
threadpool,
- mode)),
+ mode,
+ mbgl::ConstrainMode::HeightOnly,
+ mbgl::ViewportMode::Default,
+ crossSourceCollisions)),
async(new uv_async_t) {
async->data = this;
diff --git a/platform/node/src/node_map.hpp b/platform/node/src/node_map.hpp
index 52fc1ef659..b83a238681 100644
--- a/platform/node/src/node_map.hpp
+++ b/platform/node/src/node_map.hpp
@@ -82,6 +82,7 @@ public:
const float pixelRatio;
mbgl::MapMode mode;
+ bool crossSourceCollisions;
NodeThreadPool threadpool;
NodeMapObserver mapObserver;
std::unique_ptr<mbgl::HeadlessFrontend> frontend;