mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-25 17:37:49 +02:00
Match any *:direction key, rather than hardcoding a list
This commit is contained in:
@@ -87,7 +87,8 @@ export function actionReverse(wayId, options) {
|
||||
// Update the direction based tags as appropriate then return an updated node
|
||||
return node.update({tags: _transform(node.tags, function(acc, tagValue, tagKey) {
|
||||
// See if this is a direction tag and reverse (or use existing value if not recognised)
|
||||
if (tagKey.match(/direction$/) !== null) {
|
||||
var re = /direction$/;
|
||||
if (re.test(tagKey)) {
|
||||
acc[tagKey] = {forward: 'backward', backward: 'forward', left: 'right', right: 'left'}[tagValue] || tagValue;
|
||||
} else {
|
||||
// Use the reverseKey method to cater for situations such as traffic_sign:forward=stop
|
||||
|
||||
Reference in New Issue
Block a user