From 1ec88b47a1f00769907de7cefcefd5e69d2478f5 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Sun, 1 Jun 2025 23:58:00 +0200 Subject: [PATCH] up dashboard --- templates/public/dashboard.html.twig | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/templates/public/dashboard.html.twig b/templates/public/dashboard.html.twig index 992c006..b955589 100644 --- a/templates/public/dashboard.html.twig +++ b/templates/public/dashboard.html.twig @@ -60,12 +60,28 @@ } const postalCodes = [{% for stat in stats %}'{{ stat.zone }}'{% if not loop.last %}, {% endif %}{% endfor %}]; - + {% verbatim %} + + // exemple de recherche de villes par leur code postal: + // [out:json][timeout:25]; + // ( + // {{geocodeArea:76200}}->.searchArea_1; + // nwr["boundary"="administrative"]["admin_level"="8"] + // ["name"](area.searchArea_1); + // {{geocodeArea:76000}}->.searchArea_2; + // nwr["boundary"="administrative"]["admin_level"="8"]["name"](area.searchArea_2); + // ) ; + // out center; + {% endverbatim %} + console.log(postalCodes); let postalLines = ``; postalCodes.forEach(code => { if (/^\d+$/.test(code)) { - postalLines += `\nnode[place=city]["addr:postcode"=${code}][name];` + + {% verbatim %} + postalLines += `\n{{geocodeArea:${code}}}->.searchArea_${code};\nnwr[admin_level=8]["name"](area.searchArea_${code});` + {% endverbatim %} } }); const query = `[out:json][timeout:25];