diff options
author | Ansis Brammanis <ansis@mapbox.com> | 2017-11-10 11:32:37 -0500 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2017-11-17 10:05:15 -0800 |
commit | 22c07596a0c1e2cca12df730be4448bbe79be13d (patch) | |
tree | 6f50cda446e03660c6e34aae4122177cffd73fe9 /platform/node/src/node_map.cpp | |
parent | 5bdee52e5c441e6daaae7cf9f320257d0ea3d031 (diff) | |
download | qtlocation-mapboxgl-22c07596a0c1e2cca12df730be4448bbe79be13d.tar.gz |
[core] Split MapMode::Still into Static and Tile
`Tile` makes sure the symbols in the resulting tile are tileable while
symbols in `Still` match rendering in `Continuous` mode.
Diffstat (limited to 'platform/node/src/node_map.cpp')
-rw-r--r-- | platform/node/src/node_map.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp index 6deccf05bf..b8c5e9cc88 100644 --- a/platform/node/src/node_map.cpp +++ b/platform/node/src/node_map.cpp @@ -548,7 +548,7 @@ 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, mbgl::MapMode::Still); + *this, threadpool, mode); // FIXME: Reload the style after recreating the map. We need to find // a better way of canceling an ongoing rendering on the core level @@ -1074,6 +1074,15 @@ NodeMap::NodeMap(v8::Local<v8::Object> options) ->NumberValue() : 1.0; }()) + , mode([&] { + Nan::HandleScope scope; + if (Nan::Has(options, Nan::New("mode").ToLocalChecked()).FromJust() && + std::string(*v8::String::Utf8Value(Nan::Get(options, Nan::New("mode").ToLocalChecked()).ToLocalChecked()->ToString())) == "tile") { + return mbgl::MapMode::Tile; + } else { + return mbgl::MapMode::Static; + } + }()) , mapObserver(NodeMapObserver()) , frontend(std::make_unique<mbgl::HeadlessFrontend>(mbgl::Size { 256, 256 }, pixelRatio, *this, threadpool)) , map(std::make_unique<mbgl::Map>(*frontend, @@ -1082,7 +1091,7 @@ NodeMap::NodeMap(v8::Local<v8::Object> options) pixelRatio, *this, threadpool, - mbgl::MapMode::Still)), + mode)), async(new uv_async_t) { async->data = this; |