From ce392e696491b2680e8a33f3a0855b5ea6061dc4 Mon Sep 17 00:00:00 2001 From: Kevin Nowaczyk Date: Wed, 15 May 2024 16:54:49 -0400 Subject: [PATCH] Update building.js --- src/building.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/building.js b/src/building.js index 00a790d..c359e39 100644 --- a/src/building.js +++ b/src/building.js @@ -61,7 +61,7 @@ class Building { this.type = 'relation'; } if (this.isValidData(outerElementXml)) { - this.buildNodeList(); + this.nodelist = this.buildNodeList(this.fullXmlData); this.setHome(); this.repositionNodes(); if (this.type === 'way') { @@ -98,8 +98,8 @@ class Building { /** * build an array of all the lat/long values of the nodes */ - buildNodeList() { - const nodeElements = this.fullXmlData.getElementsByTagName('node'); + static buildNodeList(fullXmlData) { + const nodeElements = fullXmlData.getElementsByTagName('node'); let id = 0; var node; var coordinates = []; @@ -111,7 +111,7 @@ class Building { coordinates = [node.getAttribute('lon'), node.getAttribute('lat')]; nodeList[id] = coordinates; } - this.nodeList = nodeList; + return nodeList; } /**