diff --git a/data/presets.yaml b/data/presets.yaml index d1fdc1fa7..7c15b9666 100644 --- a/data/presets.yaml +++ b/data/presets.yaml @@ -1829,6 +1829,9 @@ en: relation: name: Relation terms: "" + roundabout: + name: Roundabout + terms: "" route/ferry: name: Ferry Route terms: "" diff --git a/data/presets/presets.json b/data/presets/presets.json index f5ea84352..3fcf27b17 100644 --- a/data/presets/presets.json +++ b/data/presets/presets.json @@ -6804,6 +6804,17 @@ "relation" ] }, + "roundabout": { + "geometry": [ + "vertex", + "line" + ], + "tags": { + "junction": "roundabout" + }, + "name": "Roundabout", + "searchable": false + }, "route/ferry": { "icon": "ferry", "geometry": [ diff --git a/data/presets/presets/roundabout.json b/data/presets/presets/roundabout.json new file mode 100644 index 000000000..05916a536 --- /dev/null +++ b/data/presets/presets/roundabout.json @@ -0,0 +1,11 @@ +{ + "geometry": [ + "vertex", + "line" + ], + "tags": { + "junction": "roundabout" + }, + "name": "Roundabout", + "searchable": false +} diff --git a/data/taginfo.json b/data/taginfo.json index d9dc3b7b4..94dfb30e9 100644 --- a/data/taginfo.json +++ b/data/taginfo.json @@ -1629,6 +1629,10 @@ "key": "railway", "value": "tram" }, + { + "key": "junction", + "value": "roundabout" + }, { "key": "route", "value": "ferry" diff --git a/dist/locales/en.json b/dist/locales/en.json index a9adfe570..869941454 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -2960,6 +2960,10 @@ "name": "Relation", "terms": "" }, + "roundabout": { + "name": "Roundabout", + "terms": "" + }, "route/ferry": { "name": "Ferry Route", "terms": "" diff --git a/js/id/presets.js b/js/id/presets.js index 48363a756..f365202b4 100644 --- a/js/id/presets.js +++ b/js/id/presets.js @@ -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; } });