We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 707017b commit 966fa33Copy full SHA for 966fa33
src/extras/BuildingShapeUtils.js
@@ -37,7 +37,7 @@ class BuildingShapeUtils extends ShapeUtils {
37
}
38
39
/**
40
- * Check if a way is a cloased shape.
+ * Check if a way is a closed shape.
41
*
42
* @param {DOM.Element} way - OSM XML way element.
43
@@ -62,12 +62,13 @@ class BuildingShapeUtils extends ShapeUtils {
62
nodes.pop();
63
64
const refs = [];
65
-
66
- // foreach (node in way)
67
- // if (the ref value exists in the array)
68
- // return true;
69
- // push ref value to array
70
- // return false;
+ for (let i = 0; i < nodes.length - 1; i++) {
+ if (refs.inclides(nodes[i].getAttribute('ref')){
+ return true;
+ }
+ nodes.push(nodes[i].getAttribute('ref'));
71
+ return false;
72
73
74
0 commit comments