diff --git a/apps/golfview/custom.html b/apps/golfview/custom.html index 48bfce5bc..73b101a7e 100644 --- a/apps/golfview/custom.html +++ b/apps/golfview/custom.html @@ -8,56 +8,52 @@ -
- - - -
-

No course loaded.

- - -
-
-

A course needs a few things to be parsed correctly by this tool.

- - Example Course -
- +
+ + +
+
+
    +
    +
    +

    No course loaded.

    + + +
    +
    +

    A course needs a few things to be parsed correctly by this tool.

    +
    + Example Course +
    + @@ -67,6 +63,7 @@ const search_url = "https://nominatim.openstreetmap.org/search"; let search_query = null; let course_input = null; + let current_course = null; let search_results = $("#searchresults"); function courseSearch() { @@ -76,9 +73,6 @@ "q": inputVal, }; doSearch(); - - // query = `[out:json][timeout:5];way(${inputVal});map_to_area ->.golfcourse;way["golf"="hole"](area.golfcourse)->.holes;(relation["golf"="fairway"](area.golfcourse);way["golf"~"^(green|tee|water_hazard|bunker|fairway)"](area.golfcourse);)->.features;.holes out geom;.features out geom;`; - // doQuery(); } function processFeatures(course_verbose) { @@ -150,7 +144,6 @@ } var courses = []; - var course_name = "Davis"; $("#upload").click(function () { sendCustomizedApp({ storage: courses, @@ -158,9 +151,13 @@ }); $("#download").click(function () { - downloadObjectAsJSON(courses[0].content, "golfcourse-" + course_name); + downloadObjectAsJSON(courses[0].content, "golfcourse-download"); }); + function testfunc(params) { + console.log(params); + } + // download info from the course function doSearch() { $.get(search_url, search_query, function (result) { @@ -173,25 +170,35 @@ for (let index = 0; index < result.length; index++) { const element = result[index]; if (element.type != "golf_course") continue; - search_results.append($("
  • ").append($("").attr('href', 'google.com').text(element.display_name))); + search_results.append($("
  • ") + .append($("

    ").text(element.display_name) + .append($("

    ") + .append($('