Fix building view animation + some refactoring
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user