Skip to content

Commit 6be9a7c

Browse files
authored
Update BuildingShapeUtils.js
1 parent 704dbfd commit 6be9a7c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/extras/BuildingShapeUtils.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,15 @@ class BuildingShapeUtils extends ShapeUtils {
8585
openWays.push(result);
8686
i++;
8787
changed = true;
88+
} else if (way1[0].getAttribute('ref') === way2[0].getAttribute('ref')) {
89+
const tempway = BuildingShapeUtils.reverseWay(ways[i])
90+
const result = BuildingShapeUtils.joinWays(tempway, ways[i + 1]);
91+
}
92+
} else if (way1[way1.length - 1].getAttribute('ref') === way2[way2.length - 1].getAttribute('ref')) {
93+
const tempway = BuildingShapeUtils.reverseWay(ways[i + 1])
94+
const result = BuildingShapeUtils.joinWays(ways[i], tempway);
8895
} else {
89-
openWays.push(way1);
96+
openWays.push(ways[i]);
9097
}
9198
}
9299
}

0 commit comments

Comments
 (0)