feat: fitMapToScreen on canvas site restoring

This commit is contained in:
Azgaar 2023-11-19 17:12:09 +04:00
parent 54721f2100
commit 20b09e8634

View file

@ -178,6 +178,14 @@ function mapSizeInputChange() {
}
}
function restoreDefaultCanvasSize() {
mapWidthInput.value = window.innerWidth;
mapHeightInput.value = window.innerHeight;
localStorage.removeItem("mapHeight");
localStorage.removeItem("mapWidth");
fitMapToScreen();
}
// on map creation
function applyGraphSize() {
graphWidth = +mapWidthInput.value;
@ -212,13 +220,6 @@ function fitMapToScreen() {
if (window.fitLegendBox) fitLegendBox();
}
function restoreDefaultCanvasSize() {
mapWidthInput.value = window.innerWidth;
mapHeightInput.value = window.innerHeight;
localStorage.removeItem("mapHeight");
localStorage.removeItem("mapWidth");
}
function toggleTranslateExtent(el) {
const on = (el.dataset.on = +!+el.dataset.on);
if (on) {