mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-23 00:29:50 +02:00
Differentiate between paved/unpaved roads (closes #2564)
Now `iD.svg.TagClasses` will add the class 'tag-unpaved' for unpaved roads.
This commit is contained in:
@@ -30,6 +30,17 @@ iD.oneWayTags = {
|
||||
}
|
||||
};
|
||||
|
||||
iD.pavedTags = {
|
||||
'surface': {
|
||||
'paved': true,
|
||||
'asphalt': true,
|
||||
'concrete': true
|
||||
},
|
||||
'tracktype': {
|
||||
'grade1': true
|
||||
}
|
||||
};
|
||||
|
||||
iD.interestingTag = function (key) {
|
||||
return key !== 'attribution' &&
|
||||
key !== 'created_by' &&
|
||||
|
||||
@@ -79,6 +79,21 @@ iD.svg.TagClasses = function() {
|
||||
classes += ' tag-' + k + ' tag-' + k + '-' + v;
|
||||
}
|
||||
|
||||
// For highways, look for surface tagging..
|
||||
if (primary === 'highway') {
|
||||
var paved = (t.highway !== 'track');
|
||||
for (k in t) {
|
||||
v = t[k];
|
||||
if (k in iD.pavedTags) {
|
||||
paved = !!iD.pavedTags[k][v];
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!paved) {
|
||||
classes += ' tag-unpaved';
|
||||
}
|
||||
}
|
||||
|
||||
classes = classes.trim();
|
||||
|
||||
if (classes !== value) {
|
||||
|
||||
Reference in New Issue
Block a user