diff --git a/index.html b/index.html index cb507fbd..9db5deea 100644 --- a/index.html +++ b/index.html @@ -3525,6 +3525,18 @@ +
+ + +
+
+ + +
+
+ + +

diff --git a/modules/submap.js b/modules/submap.js index c115f6fa..20bd9d23 100644 --- a/modules/submap.js +++ b/modules/submap.js @@ -172,6 +172,7 @@ window.Submap = (function () { pack.states = parentMap.pack.states; // keep valid states and neighbors only pack.states.forEach((s, i) => { + if (s.removed) return; if (!validStates.has(i)) s.removed=true; s.neighbors = s.neighbors.filter(n => validStates.has(n)); }); @@ -204,10 +205,10 @@ window.Submap = (function () { Rivers.specify(); Lakes.generateName(); - stage("Modelling military."); - Military.generate(); - addMarkers(); - addZones(); + stage("Modelling military, markers and zones (if requested)."); + if (options.addMilitary) Military.generate(); + if (options.addMarkers) addMarkers(); + if (options.addZones) addZones(); Names.getMapName(); stage("Submap done."); @@ -266,6 +267,7 @@ window.Submap = (function () { } const [water, coast] = res; [b.x, b.y] = b.port? getMiddlePoint(coast, water): cells.p[coast]; + if (b.port) b.port = cells.f[water]; b.cell = coast; } if (b.port) { // find coast for ports on land @@ -274,6 +276,7 @@ window.Submap = (function () { if (res) { const [coast, water] = res; [b.x, b.y] = getMiddlePoint(coast, water); + b.port = cells.f[water]; // copy feature number b.cell = coast; } else { WARN && console.warn(`Can't find water near port ${b.name}. :-/`); diff --git a/modules/ui/submap.js b/modules/ui/submap.js index d7b6401f..b9331987 100644 --- a/modules/ui/submap.js +++ b/modules/ui/submap.js @@ -24,6 +24,9 @@ const generateSubmap = debounce(async function () { depressRivers: Boolean(document.getElementById("submapDepressRivers").checked), copyBurgs: Boolean(document.getElementById("submapCopyBurgs").checked), addLakesInDepressions: Boolean(document.getElementById("submapAddLakeInDepression").checked), + addMilitary: Boolean(document.getElementById("submapAddMilitary").checked), + addMarkers: Boolean(document.getElementById("submapAddMarkers").checked), + addZones: Boolean(document.getElementById("submapAddZones").checked), } // Create projection func from current zoom extents