refactor isOneWay to properly support bidirectional ways (#10730)

This commit is contained in:
Kyℓe Hensel
2025-02-13 00:22:09 +11:00
committed by GitHub
parent 4e1c16efc7
commit 4747ae253c
12 changed files with 117 additions and 65 deletions
+3 -7
View File
@@ -7,7 +7,6 @@ import {
import { utilRebind } from '../../util/rebind';
import { t } from '../../core/localizer';
import { actionReverse } from '../../actions/reverse';
import { osmOneWayTags } from '../../osm';
import { svgIcon } from '../../svg/icon';
export { uiFieldCheck as uiFieldDefaultCheck };
@@ -61,12 +60,9 @@ export function uiFieldCheck(field, context) {
// where implied oneway tag exists (e.g. `junction=roundabout`) #2220, #1841
if (field.id === 'oneway') {
var entity = context.entity(_entityIDs[0]);
for (var key in entity.tags) {
if (key in osmOneWayTags && (entity.tags[key] in osmOneWayTags[key])) {
_impliedYes = true;
texts[0] = t.html('_tagging.presets.fields.oneway_yes.options.undefined');
break;
}
if (entity.type === 'way' && entity.isOneWay()) {
_impliedYes = true;
texts[0] = t.html('_tagging.presets.fields.oneway_yes.options.undefined');
}
}
}