diff --git a/src/main/webapp/public/club-maps.html b/src/main/webapp/public/club-maps.html index f166e7c..4e25ba3 100644 --- a/src/main/webapp/public/club-maps.html +++ b/src/main/webapp/public/club-maps.html @@ -15,8 +15,6 @@
-
- \ No newline at end of file diff --git a/src/main/webapp/public/club-maps.js b/src/main/webapp/public/club-maps.js index 3cea2db..bec2e5a 100644 --- a/src/main/webapp/public/club-maps.js +++ b/src/main/webapp/public/club-maps.js @@ -1,7 +1,4 @@ -const div_map = document.getElementById('map'); -//const div_info = document.getElementById('club_map_data'); - -const api_url = "http://localhost:5173"; +const api_url = "https://intra.ffsaf.fr"; let map = L.map('map').setView([46.631196, 2.456000], 6); @@ -27,8 +24,6 @@ const sortHoraire = (a, b) => { return a.day - b.day; } -//let last_info_show = null; - async function getData() { const response = await fetch(`${api_url}/api/club/get_map_data`); if (!response.ok) { @@ -37,20 +32,16 @@ async function getData() { const data = await response.json(); for (const d of data) { - console.log(d); - if (d.training_location.length === 0) continue; let icon = null; if (d.uuid !== null) { - console.log("logo"); - - const img = await getMeta(`http://localhost:5173/api/club/${d.uuid}/logo`); + const img = await getMeta(`${api_url}/api/club/${d.uuid}/logo`); let ratio = img.naturalHeight / img.naturalWidth; icon = L.icon({ - iconUrl: `http://localhost:5173/api/club/${d.uuid}/logo`, + iconUrl: `${api_url}/api/club/${d.uuid}/logo`, iconSize: [50, 50 * ratio], // size of the icon //shadowSize: [50, 64], // size of the shadow @@ -61,7 +52,6 @@ async function getData() { } for (const m of d.training_location) { - console.log(m); let marker; if (icon === null) marker = L.marker([m.lat, m.lng]); @@ -89,7 +79,6 @@ async function getData() { div_info.appendChild(document.createElement("br")); } else { for (const m of JSON.parse(d.training_day_time).sort(sortHoraire)) { - console.log(m); let days = ["Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi", "Dimanche"]; div_info.appendChild(document.createTextNode(`${days[m.day]}: ${timeNumberToSting(m.time_start)} - ${timeNumberToSting(m.time_end)}`)); @@ -111,24 +100,12 @@ async function getData() { } marker.bindPopup(div_info.innerHTML); - //marker.on('click', e => { - //console.log("click"); - //if (div_map.style.height !== "95vh" && last_info_show === d.name) { - //div_map.style.height = "95vh"; - //div_info.style.minHeight = "0"; - //div_info.replaceChildren(); - //} else { - //div_map.style.height = "80vh"; - //div_info.style.minHeight = "15vh"; - //div_info.replaceChildren(); - - //last_info_show = d.name; - //} - //}) + if (icon !== null){ + marker.valueOf()._icon.style.backgroundColor = '#FFFFFF'; + marker.valueOf()._icon.style.borderRadius = '10px'; + } } } } -getData().then(() => console.log("end loading")); - -console.log("test"); \ No newline at end of file +getData().then(() => console.log("end loading")); \ No newline at end of file