refactor(es modules): migrate a few more functions

This commit is contained in:
Azgaar 2022-06-27 23:00:50 +03:00
parent 14a8a31366
commit 63e9b9c87e
6 changed files with 13 additions and 10 deletions

View file

@ -2,7 +2,8 @@ import {findCell, findGridCell} from "/src/utils/graphUtils";
import {rn} from "/src/utils/numberUtils";
import {link} from "/src/utils/linkUtils";
import {getCoordinates, toDMS} from "/src/utils/coordinateUtils";
import {si} from "/src/utils/unitUtils";
import {si, convertTemperature} from "/src/utils/unitUtils";
import {stored} from "/src/utils/shorthands";
// fit full-screen map if window is resized
window.addEventListener("resize", function (e) {

View file

@ -172,7 +172,7 @@ function getCurrentPreset() {
}
// run on map regeneration
function restoreLayers() {
export function restoreLayers() {
if (layerIsOn("toggleHeight")) drawHeightmap();
if (layerIsOn("toggleCells")) drawCells();
if (layerIsOn("toggleGrid")) drawGrid();
@ -1474,7 +1474,7 @@ function toggleCoordinates(event) {
}
}
function drawCoordinates() {
export function drawCoordinates() {
if (!layerIsOn("toggleCoordinates")) return;
coordinates.selectAll("*").remove(); // remove every time
const steps = [0.5, 1, 2, 5, 10, 15, 30]; // possible steps