Skip to content

Commit 7ad6fe4

Browse files
authored
Update BuildingShapeUtils.js
1 parent d892c1e commit 7ad6fe4

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/extras/BuildingShapeUtils.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,14 @@ class BuildingShapeUtils extends ShapeUtils {
6767
if (BuildingShapeUtils.isClosed(ways[i])) {
6868
closedWays.push(ways[i]);
6969
} else {
70+
// These are HTMLCollections of nodes, not ways.
7071
const way1 = ways[i].getElementsByTagName('nd');
7172
const way2 = ways[i + 1].getElementsByTagName('nd');
73+
74+
// If the first node of way2 is the same as the last in way one, they can be combined
75+
// Or if the first node of way1 is the same as the last in way2
76+
// Need to extend this to tip-to-tip connections as well.
77+
// Need to add a "reverse way" function somewhere.
7278
if (way2[0].getAttribute('ref') === way1[way1.length - 1].getAttribute('ref')) {
7379
const result = BuildingShapeUtils.joinWays(ways[i], ways[i + 1]);
7480
openWays.push(result);

0 commit comments

Comments
 (0)