Add minimum-possible taginfo powered help.

This commit is contained in:
Tom MacWright
2012-11-13 12:09:43 -05:00
parent 42b6f04a35
commit fecf75a668
3 changed files with 28 additions and 11 deletions
+10
View File
@@ -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;
}
+10 -9
View File
@@ -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')
+8 -2
View File
@@ -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')