Treat anything with a from/via/to like a restriction

(closes #6221)

Applies to actions like splitting, connecting, extracting a via node, etc
This commit is contained in:
Bryan Housel
2019-04-29 21:53:12 -04:00
parent 2b46440429
commit a72865e4d8
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -80,7 +80,7 @@ export function actionConnect(nodeIDs) {
role = relation.memberById(node.id).role || '';
// if this node is a via node in a restriction, remember for later
if (relation.isValidRestriction()) {
if (relation.hasFromViaTo()) {
restrictionIDs.push(relation.id);
}
@@ -103,7 +103,7 @@ export function actionConnect(nodeIDs) {
for (k = 0; k < relations.length; k++) {
relation = relations[k];
if (relation.isValidRestriction()) {
if (relation.hasFromViaTo()) {
restrictionIDs.push(relation.id);
}
}
+1 -1
View File
@@ -98,7 +98,7 @@ export function actionExtract(entityID, projection) {
var parentRels = graph.parentRelations(entity);
for (var i = 0; i < parentRels.length; i++) {
var relation = parentRels[i];
if (!relation.isValidRestriction()) continue;
if (!relation.hasFromViaTo()) continue;
for (var j = 0; j < relation.members.length; j++) {
var m = relation.members[j];
+1 -1
View File
@@ -118,7 +118,7 @@ export function actionSplit(nodeId, newWayIds) {
// 1. Splitting a FROM/TO way - only `wayA` OR `wayB` remains in relation
// (whichever one is connected to the VIA node/ways)
// 2. Splitting a VIA way - `wayB` remains in relation as a VIA way
if (relation.isRestriction()) {
if (relation.hasFromViaTo()) {
var f = relation.memberByRole('from');
var v = relation.membersByRole('via');
var t = relation.memberByRole('to');
+1 -1
View File
@@ -1160,7 +1160,7 @@ describe('iD.actionSplit', function () {
});
['restriction', 'restriction:bus'].forEach(function (type) {
['restriction', 'restriction:bus', 'manoeuvre'].forEach(function (type) {
describe('type = ' + type, function () {
it('updates a restriction\'s \'from\' role - via node', function () {