From 504c0a0ed9733a216b22e3c93471b49a567b3730 Mon Sep 17 00:00:00 2001 From: Pax1601 Date: Wed, 15 Oct 2025 18:50:40 +0200 Subject: [PATCH] fix: Map now works with capitalized map names (thanks for creating this need Wirts :P) --- frontend/react/src/map/map.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/frontend/react/src/map/map.ts b/frontend/react/src/map/map.ts index 16f8ad63..bb34eb8a 100644 --- a/frontend/react/src/map/map.ts +++ b/frontend/react/src/map/map.ts @@ -561,15 +561,14 @@ export class Map extends L.Map { }) .then((res: any) => { // Convert the result keys to lower case to avoid case sensitivity issues - const lowerCaseRes: any = {}; - for (const key in res) { - lowerCaseRes[key.toLowerCase()] = res[key]; - } + let key = undefined; + if ("alt-" + theatre.toLowerCase() in res) key = "alt-" + theatre.toLowerCase(); + else if ("alt-" + theatre in res) key = "alt-" + theatre; - if ("alt-" + theatre.toLowerCase() in lowerCaseRes) { - let template = `${mirror}/alt-${theatre.toLowerCase()}/{z}/{x}/{y}.png`; + if (key) { + let template = `${mirror}/${key}/{z}/{x}/{y}.png`; layers.push( - ...lowerCaseRes["alt-" + theatre.toLowerCase()].map((layerConfig: any) => { + ...res[key].map((layerConfig: any) => { return new L.TileLayer(template, { ...layerConfig, crossOrigin: "",