Add SSGP + dynamic state
This commit is contained in:
12
js/map.js
12
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});
|
||||
|
||||
});
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user