diff options
Diffstat (limited to 'platform/node/test/suite_implementation.js')
-rw-r--r-- | platform/node/test/suite_implementation.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/platform/node/test/suite_implementation.js b/platform/node/test/suite_implementation.js index 1122b143f9..6747a14151 100644 --- a/platform/node/test/suite_implementation.js +++ b/platform/node/test/suite_implementation.js @@ -36,6 +36,11 @@ module.exports = function (style, options, callback) { overdraw: options.showOverdrawInspector, }; + options.center = style.center || [0, 0]; + options.zoom = style.zoom || 0; + options.bearing = style.bearing || 0; + options.pitch = style.pitch || 0; + map.load(style); applyOperations(options.operations, function() { @@ -56,7 +61,7 @@ module.exports = function (style, options, callback) { callback(); } else if (operation[0] === 'wait') { - var wait = function() { + var wait = function () { if (map.loaded()) { applyOperations(operations.slice(1), callback); } else { @@ -66,6 +71,13 @@ module.exports = function (style, options, callback) { wait(); } else { + // Ensure that the next `map.render(options)` does not overwrite this change. + if (operation[0] === 'setCenter') { + options.center = operations[1]; + } else if (operation[0] === 'setBearing') { + options.bearing = operations[1]; + } + map[operation[0]].apply(map, operation.slice(1)); applyOperations(operations.slice(1), callback); } |