mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-24 13:00:26 +01:00
Reorganize inspector
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user