Skip to content

Commit 8d71cab

Browse files
authored
Update building.js
1 parent ff12939 commit 8d71cab

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
@@ -206,10 +206,13 @@ class Building {
206206
} else {
207207
// Filter to all ways
208208
var parts = this.fullXmlData.getElementsByTagName('way');
209-
for (let j = 0; j < parts.length; j++) {
210-
if (parts[j].querySelector('[k="building:part"]')) {
211-
const id = parts[j].getAttribute('id');
212-
this.parts.push(new BuildingPart(id, this.fullXmlData, this.nodelist, this.outerElement.options));
209+
for (const xmlPart of parts) {
210+
if (xmlPart.querySelector('[k="building:part"]')) {
211+
const id = xmlPart.getAttribute('id');
212+
const part = new BuildingPart(id, this.fullXmlData, this.nodelist, this.outerElement.options)
213+
if (this.partIsInside(part)) {
214+
this.parts.push(part);
215+
}
213216
}
214217
}
215218
// Filter all relations

0 commit comments

Comments
 (0)