mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 13:59:27 +02:00
Add minimum-possible taginfo powered help.
This commit is contained in:
+10
@@ -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
@@ -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')
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user