From 53509820c68243737944e703553b9ba6093a07d9 Mon Sep 17 00:00:00 2001 From: Thibaut Valentin Date: Tue, 18 Nov 2025 22:02:13 +0100 Subject: [PATCH] fix: error on loading logo on maps --- src/main/webapp/public/club-maps.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/main/webapp/public/club-maps.js b/src/main/webapp/public/club-maps.js index 185c37c..f308ac8 100644 --- a/src/main/webapp/public/club-maps.js +++ b/src/main/webapp/public/club-maps.js @@ -38,18 +38,22 @@ async function getData() { let icon = null; if (d.uuid !== null) { - const img = await getMeta(`${api_url}/api/club/${d.uuid}/logo`); - let ratio = img.naturalHeight / img.naturalWidth; + try { + const img = await getMeta(`${api_url}/api/club/${d.uuid}/logo`); + let ratio = img.naturalHeight / img.naturalWidth; - icon = L.icon({ - iconUrl: `${api_url}/api/club/${d.uuid}/logo`, + icon = L.icon({ + iconUrl: `${api_url}/api/club/${d.uuid}/logo`, - iconSize: [50, 50 * ratio], // size of the icon - //shadowSize: [50, 64], // size of the shadow - iconAnchor: [25, 50 * ratio], // point of the icon which will correspond to marker's location - //shadowAnchor: [4, 62], // the same for the shadow - popupAnchor: [0, -50 * ratio] // point from which the popup should open relative to the iconAnchor - }); + iconSize: [50, 50 * ratio], // size of the icon + //shadowSize: [50, 64], // size of the shadow + iconAnchor: [25, 50 * ratio], // point of the icon which will correspond to marker's location + //shadowAnchor: [4, 62], // the same for the shadow + popupAnchor: [0, -50 * ratio] // point from which the popup should open relative to the iconAnchor + }); + }catch (e) { + console.log("Error loading image for club", d.name, e); + } } for (const m of d.training_location) { -- 2.49.0