mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 23:14:47 +02:00
Add code to treat a few special tags as areas instead of lines
even in the absense of a proper `area=yes` or `areaKeys` tag. (closes #4194)
This commit is contained in:
@@ -152,6 +152,23 @@ _.extend(osmWay.prototype, {
|
||||
|
||||
|
||||
isArea: function() {
|
||||
// `highway` and `railway` are typically linear features, but there
|
||||
// are a few exceptions that should be treated as areas, even in the
|
||||
// absense of a proper `area=yes` or `areaKeys` tag.. see #4194
|
||||
var lineKeys = {
|
||||
highway: {
|
||||
rest_area: true,
|
||||
services: true
|
||||
},
|
||||
railway: {
|
||||
roundhouse: true,
|
||||
station: true,
|
||||
traverser: true,
|
||||
turntable: true,
|
||||
wash: true
|
||||
}
|
||||
};
|
||||
|
||||
if (this.tags.area === 'yes')
|
||||
return true;
|
||||
if (!this.isClosed() || this.tags.area === 'no')
|
||||
@@ -160,6 +177,9 @@ _.extend(osmWay.prototype, {
|
||||
if (key in areaKeys && !(this.tags[key] in areaKeys[key])) {
|
||||
return true;
|
||||
}
|
||||
if (key in lineKeys && this.tags[key] in lineKeys[key]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user