From 074bbc3d0fd565df26c69c51c695c20543e6d50d Mon Sep 17 00:00:00 2001 From: "Lukas Rieger (Blue)" Date: Sun, 15 Sep 2024 10:22:18 +0200 Subject: [PATCH] Allow only providing the map-id in the page-adress, fixes: #589 --- common/webapp/src/js/BlueMapApp.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/webapp/src/js/BlueMapApp.js b/common/webapp/src/js/BlueMapApp.js index 9cde275c..b8a8a16d 100644 --- a/common/webapp/src/js/BlueMapApp.js +++ b/common/webapp/src/js/BlueMapApp.js @@ -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;