Skip to content

Instantly share code, notes, and snippets.

@bhousel
Created January 24, 2016 06:15
Show Gist options
  • Save bhousel/9e8d06e1a768fca0ea64 to your computer and use it in GitHub Desktop.
Save bhousel/9e8d06e1a768fca0ea64 to your computer and use it in GitHub Desktop.
Debug text bboxes in #iD
// debug
var gj = rtree.all().map(function(d) {
return { type: 'Polygon', coordinates: [[
[d[0], d[1]], [d[2], d[1]], [d[2], d[3]], [d[0], d[3]], [d[0], d[1]]
]]};
});
var debug = label.selectAll('.layer-debug').data([0]);
debug.enter()
.append('g')
.attr('class', 'layer-debug');
var debugboxes = debug.selectAll('.map-in-map-bbox').data(gj);
debugboxes.enter()
.append('path')
.attr('class', 'map-in-map-bbox');
debugboxes
.attr('d', d3.geo.path().projection(null));
debugboxes.exit()
.remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment