Add SSGP + dynamic state

This commit is contained in:
2025-12-15 12:19:54 +01:00
parent 378f5f5b24
commit bc703623e8
4 changed files with 30 additions and 14 deletions

View File

@@ -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});
});