Skip to content

Commit

Permalink
Add overscaledZ to debug tile text
Browse files Browse the repository at this point in the history
  • Loading branch information
Asheem Mamoowala committed Nov 5, 2018
1 parent 0fe1311 commit cd6b183
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/render/draw_debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function drawDebug(painter: Painter, sourceCache: SourceCache, coords: Array<Ove
}
}

function drawDebugTile(painter, sourceCache, coord) {
function drawDebugTile(painter, sourceCache, coord: OverscaledTileID) {
const context = painter.context;
const gl = context.gl;

Expand All @@ -40,7 +40,12 @@ function drawDebugTile(painter, sourceCache, coord) {
debugUniformValues(posMatrix, Color.red), id,
painter.debugBuffer, painter.tileBorderIndexBuffer, painter.debugSegments);

const vertices = createTextVerticies(coord.canonical.toString(), 50, 200, 5);
let tileIdText = coord.canonical.toString();
if (coord.overscaledZ !== coord.canonical.z) {
tileIdText += ` => ${coord.overscaledZ}`;
}

const vertices = createTextVertices(tileIdText, 50, 200, 5);
const debugTextArray = new PosArray();
const debugTextIndices = new LineIndexArray();
for (let v = 0; v < vertices.length; v += 2) {
Expand Down

0 comments on commit cd6b183

Please sign in to comment.