Restructure to use separate scenes

Uses pseudo-router logic...
This commit is contained in:
2026-01-14 16:42:39 +01:00
parent 8c1da5e4e2
commit e85bd4f959
13 changed files with 307 additions and 206 deletions

View File

@@ -1,7 +1,6 @@
// Global Leaflet and ATON
import {config} from '../config.js';
import Scene from './scene.js';
import AppState from './state.js';
const Map = {};
@@ -29,7 +28,7 @@ Map.init = function(mapContainerId) {
const popup = this.domParser.parseFromString(marker.popup, 'text/html')
.querySelector('div');
popup.querySelector('button').onclick = () => {
Scene.openScene(marker);
this.goToScene(marker.uri);
map.getContainer().classList.toggle('d-none');
};
@@ -41,4 +40,12 @@ Map.init = function(mapContainerId) {
AppState.map = map;
}
/**
*
* @param {String} uri The scene's absolute URI (from config)
*/
Map.goToScene = function (uri) {
location.href = uri;
}
export default Map;