Skip to content

Commit c11363e

Browse files
authored
Update building.js
1 parent ad7327c commit c11363e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/building.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,14 @@ class Building {
217217
}
218218
// Filter all relations
219219
parts = this.fullXmlData.getElementsByTagName('relation');
220-
for (let i = 0; i < parts.length; i++) {
221-
if (parts[i].querySelector('[k="building:part"]')) {
222-
const id = parts[i].getAttribute('id');
220+
for (const xmlPart of parts) {
221+
if (xmlPart.querySelector('[k="building:part"]')) {
222+
const id = xmlPart.getAttribute('id');
223223
try {
224-
this.parts.push(new MultiBuildingPart(id, this.fullXmlData, this.nodelist, this.outerElement.options));
224+
const part = new MultiBuildingPart(id, this.fullXmlData, this.nodelist, this.outerElement.options)
225+
if (this.partIsInside(part)) {
226+
this.parts.push(part);
227+
}
225228
} catch (e) {
226229
window.printError(e);
227230
}

0 commit comments

Comments
 (0)