Skip to content

Commit

Permalink
Update BuildingShapeUtils.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Beakerboy authored May 9, 2024
1 parent 5d2640e commit 63d8ba5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/extras/BuildingShapeUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class BuildingShapeUtils extends ShapeUtils {
static isClosed(way) {
// Get all the nodes in the way of interest
const elements = way.getElementsByTagName('nd');
return elements[0].getAttribute('ref') == elements[elements.length - 1].getAttribute('ref')
return elements[0].getAttribute('ref') === elements[elements.length - 1].getAttribute('ref');
}

/**
Expand All @@ -60,14 +60,14 @@ class BuildingShapeUtils extends ShapeUtils {
static combineWays(ways) {
var output = [];
for (let i = 0; i < ways.length; i++) {
if (isClosed(ways[i])) {
output.push(ways[i])
if (BuildingShapeUtils.isClosed(ways[i])) {
output.push(ways[i]);
}
else {
}
}
}

/**
* Find the center of a closed way
*
Expand Down

0 comments on commit 63d8ba5

Please sign in to comment.