mirror of https://github.com/espruino/BangleApps
dealt with fairways in relations
parent
3ac987c1e2
commit
3273ebfa15
|
@ -64,9 +64,15 @@
|
||||||
course_processed.holes[current_hole.toString()] = hole;
|
course_processed.holes[current_hole.toString()] = hole;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (element.type == "way") { // TODO deal with relations
|
else {
|
||||||
// if we find a feature add it to the corresponding hole
|
|
||||||
if (!("ref" in element.tags)) continue;
|
if (!("ref" in element.tags)) continue;
|
||||||
|
if (element.type == "relation") {
|
||||||
|
for (member of element.members) {
|
||||||
|
if (member.role === "outer") break; // only use the outer because it is overwritten anyway
|
||||||
|
}
|
||||||
|
Object.assign(element, { "geometry": member.geometry });
|
||||||
|
}
|
||||||
|
// if we find a feature add it to the corresponding hole
|
||||||
let active_holes = element.tags.ref.split(";"); // a feature can be on more than one hole
|
let active_holes = element.tags.ref.split(";"); // a feature can be on more than one hole
|
||||||
for (feature_hole of active_holes) {
|
for (feature_hole of active_holes) {
|
||||||
let new_feature = {
|
let new_feature = {
|
||||||
|
|
Loading…
Reference in New Issue