Allow disabling initial load via queryString param

This commit is contained in:
Troy Alford 2019-05-05 02:40:29 -07:00
parent 52b20f5ea4
commit dca6371b4d
2 changed files with 35 additions and 31 deletions

View file

@ -101,9 +101,11 @@ oceanLayers.append("rect").attr("id", "oceanBase").attr("x", graphWidth * -.2).a
equatorOutput.min = equatorInput.min = graphHeight * -1; equatorOutput.min = equatorInput.min = graphHeight * -1;
equatorOutput.max = equatorInput.max = graphHeight * 2; equatorOutput.max = equatorInput.max = graphHeight * 2;
const queryStringParams = new URLSearchParams(window.location.search)
applyDefaultNamesData(); // apply default namesbase on load applyDefaultNamesData(); // apply default namesbase on load
applyDefaultStyle(); // apply style 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 focusOn(); // based on searchParams focus on point, cell or burg from MFCG
addDragToUpload(); // allow map loading by drag and drop addDragToUpload(); // allow map loading by drag and drop

View file

@ -444,6 +444,8 @@ function drawStatesWithBorders() {
regions.selectAll("path").remove(); regions.selectAll("path").remove();
borders.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 cells = pack.cells, vertices = pack.vertices, states = pack.states, n = cells.i.length;
const used = new Uint8Array(cells.i.length); const used = new Uint8Array(cells.i.length);
const body = new Array(states.length).fill(""); // store path around each state const body = new Array(states.length).fill(""); // store path around each state