[tests] Implement "wait" command with Map#render
This ensures that a "wait" command will always fully flush pending update flags. This was not the case with the prior conditional map.loaded() logic.
This commit is contained in:
@@ -61,14 +61,9 @@ module.exports = function (style, options, callback) {
|
||||
callback();
|
||||
|
||||
} else if (operation[0] === 'wait') {
|
||||
var wait = function () {
|
||||
if (map.loaded()) {
|
||||
applyOperations(operations.slice(1), callback);
|
||||
} else {
|
||||
map.render(options, wait);
|
||||
}
|
||||
};
|
||||
wait();
|
||||
map.render(options, function () {
|
||||
applyOperations(operations.slice(1), callback);
|
||||
});
|
||||
|
||||
} else {
|
||||
// Ensure that the next `map.render(options)` does not overwrite this change.
|
||||
|
||||
Reference in New Issue
Block a user