Put tile and collision on the debug legend too

This commit is contained in:
Bryan Housel
2016-06-11 01:20:53 -04:00
parent 452df4068e
commit c08774c2da
+13 -3
View File
@@ -10,13 +10,21 @@ iD.svg.Debug = function(projection, context) {
}
function drawDebug(surface) {
var showsImagery = context.getDebug('imagery'),
var showsTile = context.getDebug('tile'),
showsCollision = context.getDebug('collision'),
showsImagery = context.getDebug('imagery'),
showsImperial = context.getDebug('imperial'),
showsDriveLeft = context.getDebug('driveLeft'),
path = d3.geo.path().projection(projection);
var debugData = [];
if (showsTile) {
debugData.push({ class: 'red', label: 'tile' });
}
if (showsCollision) {
debugData.push({ class: 'yellow', label: 'collision' });
}
if (showsImagery) {
debugData.push({ class: 'orange', label: 'imagery' });
}
@@ -53,7 +61,7 @@ iD.svg.Debug = function(projection, context) {
var layer = surface.selectAll('.layer-debug')
.data(debugData.length ? [0] : []);
.data(showsImagery || showsImperial || showsDriveLeft ? [0] : []);
layer.enter()
.append('g')
@@ -115,7 +123,9 @@ iD.svg.Debug = function(projection, context) {
// chainable getter/setters, and this one is just a getter.
drawDebug.enabled = function() {
if (!arguments.length) {
return context.getDebug('imagery') ||
return context.getDebug('tile') ||
context.getDebug('collision') ||
context.getDebug('imagery') ||
context.getDebug('imperial') ||
context.getDebug('driveLeft');
} else {