diff --git a/js/render/draw_debug.js b/js/render/draw_debug.js index 9544a8fe405..a86ad9c3b9e 100644 --- a/js/render/draw_debug.js +++ b/js/render/draw_debug.js @@ -5,20 +5,20 @@ var browser = require('../util/browser'); module.exports = drawDebug; -function drawDebug(painter, coords) { +function drawDebug(painter, source, coords) { if (painter.isOpaquePass) return; if (!painter.options.debug) return; for (var i = 0; i < coords.length; i++) { - drawDebugTile(painter, coords[i]); + drawDebugTile(painter, source, coords[i]); } } -function drawDebugTile(painter, coord) { +function drawDebugTile(painter, source, coord) { var gl = painter.gl; var shader = painter.debugShader; - gl.switchShader(shader, painter.calculatePosMatrix(coord)); + gl.switchShader(shader, painter.calculatePosMatrix(coord, source.maxzoom)); // draw bounding rectangle gl.bindBuffer(gl.ARRAY_BUFFER, painter.debugBuffer); diff --git a/js/render/painter.js b/js/render/painter.js index 30059eb9964..fd2a8c4fa84 100644 --- a/js/render/painter.js +++ b/js/render/painter.js @@ -299,7 +299,9 @@ Painter.prototype.renderPass = function(options) { this.renderLayer(this, source, layer, coords); } - draw.debug(this, coords); + if (source) { + draw.debug(this, source, coords); + } } }; diff --git a/package.json b/package.json index 9743e765183..996d9ffe556 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,7 @@ "eslint": "^1.5.0", "eslint-config-mourner": "^1.0.0", "istanbul": "^0.4.1", - "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#3fe57d5b2c885f758cc7667dbcce14a214b790e0", + "mapbox-gl-test-suite": "mapbox/mapbox-gl-test-suite#ff214a62ba73fd64defffc40bffa3a2dfb7b2b55", "prova": "^2.1.2", "sinon": "^1.15.4", "st": "^1.0.0", diff --git a/test/render.test.js b/test/render.test.js index b3bc14c8ddd..b6d2f2f9971 100644 --- a/test/render.test.js +++ b/test/render.test.js @@ -28,6 +28,9 @@ suite.run('js', {tests: tests}, function(style, options, callback) { attributionControl: false }); + if (options.debug) map.debug = true; + if (options.collisionDebug) map.collisionDebug = true; + var gl = map.painter.gl; map.once('load', function() {