mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 23:44:47 +02:00
Check single source for implied onewayness #2220
This commit is contained in:
@@ -204,6 +204,7 @@
|
||||
<script src='js/id/core/way.js'></script>
|
||||
<script src='js/id/core/tree.js'></script>
|
||||
<script src='js/id/core/area_keys.js'></script>
|
||||
<script src='js/id/core/oneway_tags.js'></script>
|
||||
|
||||
<script src='js/id/presets.js'></script>
|
||||
<script src='js/id/presets/preset.js'></script>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
iD.oneWayTags = {
|
||||
'aerialway': {
|
||||
'chair_lift': true,
|
||||
'mixed_lift': true,
|
||||
't-bar': true,
|
||||
'j-bar': true,
|
||||
'platter': true,
|
||||
'rope_tow': true,
|
||||
'magic_carpet': true,
|
||||
'yes': true
|
||||
},
|
||||
'highway': {
|
||||
'motorway': true,
|
||||
'motorway_link': true
|
||||
},
|
||||
'junction': {
|
||||
'roundabout': true
|
||||
},
|
||||
'man_made': {
|
||||
'piste:halfpipe': true,
|
||||
'pipeline': true
|
||||
},
|
||||
'piste:type': {
|
||||
'downhill': true,
|
||||
'sled': true,
|
||||
'yes': true
|
||||
},
|
||||
'waterway': {
|
||||
'river': true,
|
||||
'stream': true
|
||||
}
|
||||
};
|
||||
+5
-5
@@ -48,11 +48,11 @@ _.extend(iD.Way.prototype, {
|
||||
if (['no', '0'].indexOf(this.tags.oneway) !== -1) { return false; }
|
||||
|
||||
// implied oneway tag..
|
||||
return this.tags.waterway === 'river' ||
|
||||
this.tags.waterway === 'stream' ||
|
||||
this.tags.highway === 'motorway' ||
|
||||
this.tags.highway === 'motorway_link' ||
|
||||
this.tags.junction === 'roundabout';
|
||||
for (var key in this.tags) {
|
||||
if (key in iD.oneWayTags && (this.tags[key] in iD.oneWayTags[key]))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
isClosed: function() {
|
||||
|
||||
@@ -21,10 +21,16 @@ iD.ui.preset.defaultcheck = function(field) {
|
||||
}
|
||||
|
||||
var check = function(selection) {
|
||||
// hack: pretend oneway field is a oneway_yes field if `junction=roundabout` is set. #2220, #1841
|
||||
if (field.id === 'oneway' && entity.tags.junction === 'roundabout') {
|
||||
texts.shift();
|
||||
texts.unshift(t('presets.fields.oneway_yes.check.undefined', { 'default': 'Assumed to be Yes' }));
|
||||
// hack: pretend oneway field is a oneway_yes field
|
||||
// where implied oneway tag exists (e.g. `junction=roundabout`) #2220, #1841
|
||||
if (field.id === 'oneway') {
|
||||
for (var key in entity.tags) {
|
||||
if (key in iD.oneWayTags && (entity.tags[key] in iD.oneWayTags[key])) {
|
||||
texts.shift();
|
||||
texts.unshift(t('presets.fields.oneway_yes.check.undefined', { 'default': 'Assumed to be Yes' }));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
selection.classed('checkselect', 'true');
|
||||
|
||||
@@ -185,6 +185,7 @@
|
||||
<script src='../js/id/core/way.js'></script>
|
||||
<script src='../js/id/core/tree.js'></script>
|
||||
<script src='../js/id/core/area_keys.js'></script>
|
||||
<script src='../js/id/core/oneway_tags.js'></script>
|
||||
|
||||
<script src='../js/id/presets.js'></script>
|
||||
<script src='../js/id/presets/preset.js'></script>
|
||||
|
||||
Reference in New Issue
Block a user