From 3273ebfa15020815e894d9606f8cce0af59614f2 Mon Sep 17 00:00:00 2001 From: Jason Dekarske Date: Thu, 7 Apr 2022 13:20:56 -0700 Subject: [PATCH] dealt with fairways in relations --- apps/golfview/custom.html | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/golfview/custom.html b/apps/golfview/custom.html index 3b4485267..e900272a8 100644 --- a/apps/golfview/custom.html +++ b/apps/golfview/custom.html @@ -64,9 +64,15 @@ course_processed.holes[current_hole.toString()] = hole; } - else if (element.type == "way") { // TODO deal with relations - // if we find a feature add it to the corresponding hole + else { 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 for (feature_hole of active_holes) { let new_feature = {