mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-18 10:01:23 +01:00
refactor(es modules): migrate a few more functions
This commit is contained in:
parent
14a8a31366
commit
63e9b9c87e
6 changed files with 13 additions and 10 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue