Allow only providing the map-id in the page-adress, fixes: #589

This commit is contained in:
Lukas Rieger (Blue) 2024-09-15 10:22:18 +02:00
parent 48fa5b6abc
commit 074bbc3d0f
No known key found for this signature in database
GPG Key ID: AA33883B1BBA03E6

View File

@ -710,6 +710,18 @@ export class BlueMapApp {
let hash = window.location.hash?.substring(1) || this.settings.startLocation || "";
let values = hash.split(":");
// only world is provided
if (values.length === 1 && (!this.mapViewer.map || this.mapViewer.map.data.id !== values[0])) {
try {
await this.switchMap(values[0]);
} catch (e) {
return false;
}
return true;
}
// load full location
if (values.length !== 10) return false;
let controls = this.mapViewer.controlsManager;