Skip to content

Commit

Permalink
Allow only providing the map-id in the page-adress, fixes: #589
Browse files Browse the repository at this point in the history
  • Loading branch information
TBlueF committed Sep 15, 2024
1 parent 48fa5b6 commit 074bbc3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions common/webapp/src/js/BlueMapApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 074bbc3

Please sign in to comment.