Reorganize inspector

This commit is contained in:
Tom MacWright
2012-11-01 12:00:27 -04:00
parent affb49e3ba
commit b2e780c4c9
3 changed files with 21 additions and 17 deletions

View File

@@ -150,12 +150,9 @@ iD.Map = function(parentSelector) {
return a.type === 'node';
});
var fills = fill_g.selectAll('path.area')
.data(areas, key),
casings = casing_g.selectAll('path.casing')
.data(ways, key),
strokes = stroke_g.selectAll('path.stroke')
.data(ways, key),
var fills = fill_g.selectAll('path.area').data(areas, key),
casings = casing_g.selectAll('path.casing').data(ways, key),
strokes = stroke_g.selectAll('path.stroke').data(ways, key),
markers = hit_g.selectAll('image.marker')
.data(points.filter(iD.markerimage), key);

View File

@@ -18,36 +18,37 @@ iD.Inspector = function(graph) {
.attr('class', 'permalink')
.attr('href', 'http://www.openstreetmap.org/browse/' +
d.type + '/' + d.id)
.text('#' + d.id);
.text('OSM');
head.append('a')
.attr('class', 'permalink')
.attr('href', '#')
.text(d.id + '.geojson')
.text('GeoJSON')
.on('click', function() {
iD.Util.codeWindow(
JSON.stringify(iD.GeoJSON.mapping(graph.fetch(d.id)), null, 2));
d3.event.stopPropagation();
iD.Util.codeWindow(JSON.stringify(
iD.GeoJSON.mapping(graph.fetch(d.id)), null, 2));
});
var table = d3.select(this)
.append('table')
.attr('class', 'inspector');
var tbody = table.append('tbody');
table.append('thead').append('tr').selectAll('th')
.data(['tag', 'value'])
.enter()
.append('th')
.text(String);
var tbody = table.append('tbody');
var row = tbody.selectAll('tr')
.data(d3.entries(d.tags))
.enter()
.append('tr');
row.append('td').append('input')
.attr('class', 'tag-key')
.property('value', function(d) { return d.key; })
.on('change', function(row) {
row.key = this.key;