Fix building view animation + some refactoring

This commit is contained in:
2026-09-15 18:47:05 +02:00
parent 91b1764913
commit 1c807cdc86
4 changed files with 62 additions and 40 deletions
+31
View File
@@ -0,0 +1,31 @@
import { GisState } from "./state.js";
/**
* Functions / utilities to manipulate the Leaflet map
* @module Map
*/
/**
* Saves the current state of the map
* @param {L.Map} map
*/
export function saveCurrentState(map) {
let currentBase = {};
for (let key of Object.keys(GisState.baseLayers)) {
if (map.hasLayer(GisState.baseLayers[key])) {
currentBase = GisState.baseLayers[key];
break;
}
}
GisState.currentMapState = {
baseLayer: currentBase,
zoom: map.getZoom(),
center: map.getCenter(),
minZoom: map.getMinZoom(),
maxZoom: map.getMaxZoom(),
}
}
function getCurrentState() {
//TODO
}