@orbat-mapper/tactical-map-sheet 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -112,9 +112,8 @@ normalized and resolves to its southwest grid intersection, then optionally snap
|
|
|
112
112
|
Its complete fixed 8 mm black crosshair and labels must fit inside the printable frame. A non-empty
|
|
113
113
|
authored label is placed inward from the crosshair. Otherwise, the MGRS easting is placed to its left
|
|
114
114
|
and the northing below it in the conventional abbreviated arrangement. At 100 km precision, the
|
|
115
|
-
grid-square column and row letters take those positions. At least
|
|
116
|
-
|
|
117
|
-
omitted or moved.
|
|
115
|
+
grid-square column and row letters take those positions. At least two marks must resolve to distinct
|
|
116
|
+
positions. Any invalid mark rejects the complete request; marks are never omitted or moved.
|
|
118
117
|
|
|
119
118
|
Registered overlays are transparent. An explicit non-transparent `page.background` is rejected.
|
|
120
119
|
SVG and PDF results expose the same ordered `registrationMarks`, each containing the authored ID,
|
package/dist/{create-tactical-map-sheet-DSmO71Oa.mjs → create-tactical-map-sheet-Ch8io55k.mjs}
RENAMED
|
@@ -1814,16 +1814,11 @@ function assertMarkFits(point, labels, frame, id) {
|
|
|
1814
1814
|
const strokeEdge = 4.1;
|
|
1815
1815
|
if (!(point.xMm - strokeEdge >= frame.xMm && point.xMm + strokeEdge <= frame.xMm + frame.widthMm && point.yMm - strokeEdge >= frame.yMm && point.yMm + strokeEdge <= frame.yMm + frame.heightMm) || labels.some((label) => !contains(frame, textBounds(label)))) throw new RangeError(`Registration mark ${JSON.stringify(id)} and its label must fit within the printable map frame`);
|
|
1816
1816
|
}
|
|
1817
|
-
function
|
|
1818
|
-
const minimumX = frame.widthMm * .25;
|
|
1819
|
-
const minimumY = frame.heightMm * .25;
|
|
1820
|
-
const minimumDiagonal = Math.hypot(frame.widthMm, frame.heightMm) * .5;
|
|
1817
|
+
function hasDistinctPair(marks) {
|
|
1821
1818
|
for (let left = 0; left < marks.length; left += 1) for (let right = left + 1; right < marks.length; right += 1) {
|
|
1822
1819
|
const first = marks[left].sheetPositionMm;
|
|
1823
1820
|
const second = marks[right].sheetPositionMm;
|
|
1824
|
-
|
|
1825
|
-
const y = Math.abs(first.yMm - second.yMm);
|
|
1826
|
-
if (x >= minimumX && y >= minimumY && Math.hypot(x, y) >= minimumDiagonal) return true;
|
|
1821
|
+
if (first.xMm !== second.xMm || first.yMm !== second.yMm) return true;
|
|
1827
1822
|
}
|
|
1828
1823
|
return false;
|
|
1829
1824
|
}
|
|
@@ -1871,7 +1866,7 @@ function renderRegistration(request, context) {
|
|
|
1871
1866
|
elements
|
|
1872
1867
|
});
|
|
1873
1868
|
}
|
|
1874
|
-
if (!
|
|
1869
|
+
if (!hasDistinctPair(marks)) throw new RangeError("Registration requires marks at two distinct positions");
|
|
1875
1870
|
return {
|
|
1876
1871
|
layer: {
|
|
1877
1872
|
id: "registration-marks-0",
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as mgrsToProjected, c as projectedToMgrs, i as mgrsToGeographic, l as snapGeographicToMgrs, o as normalizeMgrsReference, r as geographicToMgrs, s as parseMgrsReference, t as createTacticalMapSheet, u as snapProjectedToMgrs } from "./create-tactical-map-sheet-
|
|
1
|
+
import { a as mgrsToProjected, c as projectedToMgrs, i as mgrsToGeographic, l as snapGeographicToMgrs, o as normalizeMgrsReference, r as geographicToMgrs, s as parseMgrsReference, t as createTacticalMapSheet, u as snapProjectedToMgrs } from "./create-tactical-map-sheet-Ch8io55k.mjs";
|
|
2
2
|
//#region src/paper.ts
|
|
3
3
|
const A0 = Object.freeze({
|
|
4
4
|
widthMm: 841,
|
package/dist/pdf.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as formatDecimal, f as MILLIMETRES_PER_CSS_PIXEL, m as openSansCentralBaselineOffset, n as createTacticalMapSheetDocument, p as POINTS_PER_MILLIMETRE } from "./create-tactical-map-sheet-
|
|
1
|
+
import { d as formatDecimal, f as MILLIMETRES_PER_CSS_PIXEL, m as openSansCentralBaselineOffset, n as createTacticalMapSheetDocument, p as POINTS_PER_MILLIMETRE } from "./create-tactical-map-sheet-Ch8io55k.mjs";
|
|
2
2
|
import { jsPDF } from "jspdf";
|
|
3
3
|
//#region src/pdf-transparency.ts
|
|
4
4
|
const FORM_DICTIONARY_MARKER = new TextEncoder().encode("/Subtype /Form\n/BBox");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbat-mapper/tactical-map-sheet",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Scale-accurate projected vector tactical map-sheet renderer.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Orbat Mapper",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"jspdf": "4.2.1",
|
|
31
31
|
"opentype.js": "2.0.0",
|
|
32
32
|
"saxes": "6.0.0",
|
|
33
|
-
"@orbat-mapper/control-measures": "^0.
|
|
33
|
+
"@orbat-mapper/control-measures": "^0.10.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@napi-rs/canvas": "1.0.7",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"typescript": "~5.9.3",
|
|
45
45
|
"vite": "^8.0.16",
|
|
46
46
|
"vitest": "^4.1.8",
|
|
47
|
-
"@orbat-mapper/point-symbols": "0.1.
|
|
47
|
+
"@orbat-mapper/point-symbols": "0.1.9"
|
|
48
48
|
},
|
|
49
49
|
"inlinedDependencies": {
|
|
50
50
|
"@types/geojson": "7946.0.16"
|