fix: Map now works with capitalized map names (thanks for creating this need Wirts :P)

This commit is contained in:
Pax1601
2025-10-15 18:50:40 +02:00
parent c77173f7c9
commit 504c0a0ed9

View File

@@ -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: "",