summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2017-11-10 13:47:35 -0500
committerAnsis Brammanis <ansis@mapbox.com>2017-11-10 13:47:35 -0500
commitb93ed14090fde76d3d4c13d2fd472bca44745ed1 (patch)
tree3c9366449ae6bc4e05f64e62a11e3e4f327760a8
parentd34c98bfb924c302804ab365c9439e4f13dc49c7 (diff)
downloadqtlocation-mapboxgl-b93ed14090fde76d3d4c13d2fd472bca44745ed1.tar.gz
fixup - switch to mode enum
-rw-r--r--platform/node/CHANGELOG.md3
-rw-r--r--platform/node/src/node_map.cpp4
-rw-r--r--platform/node/test/suite_implementation.js4
3 files changed, 7 insertions, 4 deletions
diff --git a/platform/node/CHANGELOG.md b/platform/node/CHANGELOG.md
index 4b93fca25d..feb2b4185d 100644
--- a/platform/node/CHANGELOG.md
+++ b/platform/node/CHANGELOG.md
@@ -1,3 +1,6 @@
+# master
+- The `Map` constructor now accepts a `mode` option which can be either `"static"` (default) or `"tile"`. It must be set to `"tile"` when rendering individual tiles in order for the symbols to match across tiles.
+
# 3.5.8 - October 19, 2017
- Fixes an issue that causes memory leaks when not deleting the frontend object
in NodeMap::release()
diff --git a/platform/node/src/node_map.cpp b/platform/node/src/node_map.cpp
index 3791bb1b6d..b8c5e9cc88 100644
--- a/platform/node/src/node_map.cpp
+++ b/platform/node/src/node_map.cpp
@@ -1076,8 +1076,8 @@ NodeMap::NodeMap(v8::Local<v8::Object> options)
}())
, mode([&] {
Nan::HandleScope scope;
- if (Nan::Has(options, Nan::New("tile").ToLocalChecked()).FromJust() &&
- Nan::Get(options, Nan::New("tile").ToLocalChecked()).ToLocalChecked()->BooleanValue()) {
+ 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;
diff --git a/platform/node/test/suite_implementation.js b/platform/node/test/suite_implementation.js
index 05fb76f514..b0be2fa0eb 100644
--- a/platform/node/test/suite_implementation.js
+++ b/platform/node/test/suite_implementation.js
@@ -24,7 +24,7 @@ module.exports = function (style, options, callback) {
maps.set(key, new mbgl.Map({
ratio: options.pixelRatio,
request: mapRequest,
- tile: tileMode
+ mode: options.mapMode
}));
var map = maps.get(key);
}
@@ -32,7 +32,7 @@ module.exports = function (style, options, callback) {
var map = new mbgl.Map({
ratio: options.pixelRatio,
request: mapRequest,
- tile: tileMode
+ mode: options.mapMode
});
}