diff --git a/css/app.css b/css/app.css index e3495d7f1..182aec005 100644 --- a/css/app.css +++ b/css/app.css @@ -257,3 +257,13 @@ button small { -moz-animation: spinnerAnim 1.5s infinite linear; -moz-transform-origin: 50% 50%; } + +.tag-help, +.tag-help a { + text-align:center; + background:#CED4F0; + color:#fff; + text-decoration:none; + padding:0 5px; + display:block; +} diff --git a/js/iD/renderer/Map.js b/js/iD/renderer/Map.js index eafe50c90..17d176997 100755 --- a/js/iD/renderer/Map.js +++ b/js/iD/renderer/Map.js @@ -110,12 +110,19 @@ iD.Map = function(elem) { var ways = [], areas = [], points = []; + var active_entity = null; + var selected_id = selection && selection[0]; + for (var i = 0; i < all.length; i++) { var a = all[i]; if (a.type === 'way') { a._line = nodeline(a); - if (!iD.Way.isClosed(a)) ways.push(a); - else areas.push(a); + if (!iD.Way.isClosed(a)) { + ways.push(a); + } else { + areas.push(a); + } + if (a.id === selected_id) active_entity = a; } else if (a._poi) { points.push(a); } @@ -126,8 +133,6 @@ iD.Map = function(elem) { strokes = stroke_g.selectAll('path.stroke').data(ways, key), markers = hit_g.selectAll('image.marker').data(points, key); - var selected_id = selection && selection[0]; - // Fills fills.exit().remove(); fills.enter().append('path') @@ -171,12 +176,8 @@ iD.Map = function(elem) { return 'translate(' + pt + ')'; }); - var active_entity = all.filter(function(a) { - return a.id === selected_id && a.type === 'way'; - }); - var handles = hit_g.selectAll('circle.handle') - .data(active_entity.length ? graph.fetch(active_entity[0].id).nodes : []); + .data(active_entity ? graph.fetch(active_entity.id).nodes : []); handles.exit().remove(); handles.enter().append('circle') diff --git a/js/iD/ui/Inspector.js b/js/iD/ui/Inspector.js index 3dfd8ccd2..53260c72f 100644 --- a/js/iD/ui/Inspector.js +++ b/js/iD/ui/Inspector.js @@ -44,7 +44,7 @@ iD.Inspector = function(graph) { .attr('class', 'inspector'); table.append('thead').append('tr').selectAll('th') - .data(['tag', 'value']) + .data(['tag', 'value', '']) .enter() .append('th') .text(String); @@ -76,12 +76,18 @@ iD.Inspector = function(graph) { event.update(d, newtags(table)); draw(formtags(table)); }); + + row.append('td').attr('class', 'tag-help').append('a') + .text('?') + .attr('target', '_blank') + .attr('href', function(d) { + return 'http://taginfo.openstreetmap.org/keys/' + d.key; + }); } var data = d3.entries(d.tags).concat([{ key: '', value: ''}]); draw(data); - save = d3.select(this) .append('button') .text('Save')