mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-21 11:16:36 +02:00
Fix areaKeys whitelist/blacklist and blacklist junction=roundabout
(closes #2484)
This commit is contained in:
@@ -1829,6 +1829,9 @@ en:
|
||||
relation:
|
||||
name: Relation
|
||||
terms: "<translate with synonyms or related terms for 'Relation', separated by commas>"
|
||||
roundabout:
|
||||
name: Roundabout
|
||||
terms: "<translate with synonyms or related terms for 'Roundabout', separated by commas>"
|
||||
route/ferry:
|
||||
name: Ferry Route
|
||||
terms: "<translate with synonyms or related terms for 'Ferry Route', separated by commas>"
|
||||
|
||||
@@ -6804,6 +6804,17 @@
|
||||
"relation"
|
||||
]
|
||||
},
|
||||
"roundabout": {
|
||||
"geometry": [
|
||||
"vertex",
|
||||
"line"
|
||||
],
|
||||
"tags": {
|
||||
"junction": "roundabout"
|
||||
},
|
||||
"name": "Roundabout",
|
||||
"searchable": false
|
||||
},
|
||||
"route/ferry": {
|
||||
"icon": "ferry",
|
||||
"geometry": [
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"geometry": [
|
||||
"vertex",
|
||||
"line"
|
||||
],
|
||||
"tags": {
|
||||
"junction": "roundabout"
|
||||
},
|
||||
"name": "Roundabout",
|
||||
"searchable": false
|
||||
}
|
||||
@@ -1629,6 +1629,10 @@
|
||||
"key": "railway",
|
||||
"value": "tram"
|
||||
},
|
||||
{
|
||||
"key": "junction",
|
||||
"value": "roundabout"
|
||||
},
|
||||
{
|
||||
"key": "route",
|
||||
"value": "ferry"
|
||||
|
||||
Vendored
+4
@@ -2960,6 +2960,10 @@
|
||||
"name": "Relation",
|
||||
"terms": ""
|
||||
},
|
||||
"roundabout": {
|
||||
"name": "Roundabout",
|
||||
"terms": ""
|
||||
},
|
||||
"route/ferry": {
|
||||
"name": "Ferry Route",
|
||||
"terms": ""
|
||||
|
||||
+20
-11
@@ -52,21 +52,30 @@ iD.presets = function() {
|
||||
// (see `iD.Way#isArea()`). In other words, the keys of L form the whitelist,
|
||||
// and the subkeys form the blacklist.
|
||||
all.areaKeys = function() {
|
||||
var areaKeys = {};
|
||||
|
||||
all.collection.forEach(function(d) {
|
||||
if (d.suggestion) return;
|
||||
var areaKeys = {},
|
||||
ignore = ['highway', 'footway', 'railway', 'type'],
|
||||
presets = _.reject(all.collection, 'suggestion');
|
||||
|
||||
// whitelist
|
||||
presets.forEach(function(d) {
|
||||
for (var key in d.tags) break;
|
||||
if (!key) return;
|
||||
var value = d.tags[key];
|
||||
if (ignore.indexOf(key) !== -1) return;
|
||||
|
||||
if (['highway', 'footway', 'railway', 'type'].indexOf(key) === -1) {
|
||||
if (d.geometry.indexOf('area') >= 0) {
|
||||
areaKeys[key] = areaKeys[key] || {};
|
||||
} else if (key in areaKeys && value !== '*') {
|
||||
areaKeys[key][value] = true;
|
||||
}
|
||||
if (d.geometry.indexOf('area') !== -1) {
|
||||
areaKeys[key] = areaKeys[key] || {};
|
||||
}
|
||||
});
|
||||
|
||||
// blacklist
|
||||
presets.forEach(function(d) {
|
||||
for (var key in d.tags) break;
|
||||
if (!key) return;
|
||||
if (ignore.indexOf(key) !== -1) return;
|
||||
|
||||
var value = d.tags[key];
|
||||
if (d.geometry.indexOf('area') === -1 && key in areaKeys && value !== '*') {
|
||||
areaKeys[key][value] = true;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user