diff --git a/platform/node/test/js/map.test.js b/platform/node/test/js/map.test.js index ecd89c148..d4a8a7796 100644 --- a/platform/node/test/js/map.test.js +++ b/platform/node/test/js/map.test.js @@ -141,6 +141,28 @@ test('Map', function(t) { map.release(); t.end(); }); + + t.test('does not immediately trigger any tile loads', function(t) { + var map = new mbgl.Map({ + request: function(req) { + if (req.url === './fixtures/tiles.tilejson') { + fs.readFile(path.join('test', req.url), function (err, data) { + req.respond(err, {data: data}); + }); + } else { + t.fail('unexpected request ' + req.url); + } + }, + ratio: 1 + }); + + map.load(style); + + setTimeout(function() { + map.release(); + t.end(); + }, 100); + }); }); t.test('.render', function(t) { diff --git a/src/mbgl/map/map_context.cpp b/src/mbgl/map/map_context.cpp index f6cc4ec2b..17d3a87cc 100644 --- a/src/mbgl/map/map_context.cpp +++ b/src/mbgl/map/map_context.cpp @@ -259,7 +259,7 @@ void MapContext::update() { updateFlags = Update::Nothing; } - if (updateFlags == Update::Nothing) { + if (updateFlags == Update::Nothing || (data.mode == MapMode::Still && !callback)) { return; }