Skip to content

Commit

Permalink
Update building.js
Browse files Browse the repository at this point in the history
  • Loading branch information
Beakerboy authored May 15, 2024
1 parent 3bff0d4 commit 924e7cd
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/building.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Building {
this.type = 'relation';
}
if (this.isValidData(outerElementXml)) {
this.nodelist = Building.buildNodeList(this.fullXmlData);
this.buildNodeList();
this.setHome();
this.repositionNodes();
if (this.type === 'way') {
Expand Down Expand Up @@ -97,13 +97,9 @@ class Building {

/**
* build an array of all the lat/long values of the nodes
*
* @param {DOMDocument} fullXmlData
*
* @return {[[number, number]]} array of coordinate pairs keyed by node id.
*/
static buildNodeList(fullXmlData) {
const nodeElements = fullXmlData.getElementsByTagName('node');
buildNodeList() {
const nodeElements = this.fullXmlData.getElementsByTagName('node');
let id = 0;
var node;
var coordinates = [];
Expand All @@ -115,7 +111,7 @@ class Building {
coordinates = [node.getAttribute('lon'), node.getAttribute('lat')];
nodeList[id] = coordinates;
}
return nodeList;
this.nodeList = nodeList;
}

/**
Expand Down

0 comments on commit 924e7cd

Please sign in to comment.