Compare commits

..

2 Commits

Author SHA1 Message Date
163d9b23e9 Merge pull request 'fix: error on loading logo on maps' (#67) from dev into master
Reviewed-on: #67
2025-11-18 21:02:58 +00:00
53509820c6 fix: error on loading logo on maps
All checks were successful
Deploy Production Server / if_merged (pull_request) Successful in 9m58s
2025-11-18 22:02:13 +01:00

View File

@ -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) {