From bc703623e831ea0f92536d0aa71a48b8208d737b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20P=2E?=
Date: Mon, 15 Dec 2025 12:19:54 +0100
Subject: [PATCH] Add SSGP + dynamic state
---
config.js | 23 +++++++++++++++++++----
index.html | 2 +-
js/map.js | 12 +++++++++---
js/state.js | 7 +------
4 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/config.js b/config.js
index 7fe9fce..910a104 100644
--- a/config.js
+++ b/config.js
@@ -5,6 +5,13 @@ const theater1Popup = `
`;
+const theater2Popup = `
+
+
Teatro Santi Giovanni e Paolo, Venezia
+
+
+`;
+
const audioBtn1 = `
- Un po' di elucubrazioni sull'opera lirica nel barocco ecc...
+ Lorem ipsum dolor...
Ascolta
diff --git a/js/map.js b/js/map.js
index 8e03dad..73901c3 100644
--- a/js/map.js
+++ b/js/map.js
@@ -23,7 +23,10 @@ Map.init = function(mapContainerId) {
baseMap.addTo(map);
+ //const markerIcon = L.divIcon({className: 'bi bi-bank text-large'});
+
config.markers.forEach(marker => {
+ debugger;
const popup = this.domParser.parseFromString(marker.popup, 'text/html')
.querySelector('div');
popup.querySelector('button').onclick = () => {
@@ -31,9 +34,12 @@ Map.init = function(mapContainerId) {
map.getContainer().classList.toggle('d-none');
};
- L.marker(marker.coords).addTo(map)
- .bindPopup(popup)
- .openPopup();
+ L.marker(marker.coords,).addTo(map)
+ .bindPopup(popup, {autoClose:false, /*closeOnClick:false*/})
+ .togglePopup();
+
+ // Update state
+ AppState.scenes.push({id: marker.id, active: false});
});
diff --git a/js/state.js b/js/state.js
index 1ad882c..005138f 100644
--- a/js/state.js
+++ b/js/state.js
@@ -1,12 +1,7 @@
export const AppState = {
// The root scene object
root: null,
- scenes : [
- {
- id : "salvador",
- active : false
- }
- ],
+ scenes : [],
ambientOcclusion : true,
shadows : true,
lightProbe : false,