mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2025-12-22 03:51:23 +01:00
Allow disabling initial load via queryString param
This commit is contained in:
parent
52b20f5ea4
commit
dca6371b4d
2 changed files with 35 additions and 31 deletions
4
main.js
4
main.js
|
|
@ -101,9 +101,11 @@ oceanLayers.append("rect").attr("id", "oceanBase").attr("x", graphWidth * -.2).a
|
|||
equatorOutput.min = equatorInput.min = graphHeight * -1;
|
||||
equatorOutput.max = equatorInput.max = graphHeight * 2;
|
||||
|
||||
const queryStringParams = new URLSearchParams(window.location.search)
|
||||
|
||||
applyDefaultNamesData(); // apply default namesbase on load
|
||||
applyDefaultStyle(); // apply style on load
|
||||
generate(); // generate map on load
|
||||
if (!queryStringParams.has('doNotGenerate')) generate(); // generate map on load
|
||||
focusOn(); // based on searchParams focus on point, cell or burg from MFCG
|
||||
addDragToUpload(); // allow map loading by drag and drop
|
||||
|
||||
|
|
|
|||
|
|
@ -444,6 +444,8 @@ function drawStatesWithBorders() {
|
|||
regions.selectAll("path").remove();
|
||||
borders.selectAll("path").remove();
|
||||
|
||||
if (!pack.cells || !pack.cells.i) return;
|
||||
|
||||
const cells = pack.cells, vertices = pack.vertices, states = pack.states, n = cells.i.length;
|
||||
const used = new Uint8Array(cells.i.length);
|
||||
const body = new Array(states.length).fill(""); // store path around each state
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue