@nika-js/onlymap 0.8.0 → 0.8.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/CHANGELOG.md +15 -0
- package/dist/{LercDecode.es--DH6_OFE.js → LercDecode.es-BSylOuVc.js} +1 -1
- package/dist/{basemap-2ZZ_9gFn.js → basemap-CMaYhtEE.js} +11 -1
- package/dist/basemap.d.ts +8 -0
- package/dist/cartograph/api.d.ts +1 -1
- package/dist/cartograph/elements/om-frame.d.ts +18 -0
- package/dist/cartograph/live-frame.d.ts +14 -0
- package/dist/cartograph.js +419 -378
- package/dist/cartograph.standalone.js +1158 -1117
- package/dist/elements/om-map.d.ts +2 -0
- package/dist/{geoparquet-DDZzee5Z.js → geoparquet-DZjsJtQQ.js} +1 -1
- package/dist/{index-DphcuoPv.js → index-BQkmbcQr.js} +1 -1
- package/dist/{index-BGOblzWN.js → index-Cw9SL11B.js} +1347 -1315
- package/dist/{index-DkxFFflv.js → index-DRFEoCuu.js} +1 -1
- package/dist/{index-Cz1VsWzO.js → index-Dl0UKZF-.js} +2 -2
- package/dist/{index-CeoVzd6t.js → index-tSk19VJe.js} +1 -1
- package/dist/{lerc-D7TfTy6l.js → lerc-Dphd_hZG.js} +2 -2
- package/dist/onlymap.standalone.js +2232 -2190
- package/dist/onlymapjs.js +1 -1
- package/dist/{raster-D_3YKFZz.js → raster-Bb9CjpGL.js} +3 -3
- package/dist/{raster-pipeline-D1yeoJo2.js → raster-pipeline-D_Hw3Wax.js} +1 -1
- package/dist/runtime-core.d.ts +12 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-DH5Ntt5U.js → zarr-DJA83o9G.js} +2 -2
- package/llms.txt +1 -1
- package/onlymapjs.html-data.json +4 -0
- package/package.json +5 -5
- package/skills/onlymapjs/references/syntax.md +1 -0
package/dist/cartograph.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
let
|
|
1
|
+
let kt = null, Z = null;
|
|
2
2
|
function ye(r) {
|
|
3
|
-
|
|
3
|
+
kt = r;
|
|
4
4
|
}
|
|
5
5
|
function Ze() {
|
|
6
|
-
return
|
|
6
|
+
return V !== null;
|
|
7
7
|
}
|
|
8
|
-
let
|
|
9
|
-
function
|
|
10
|
-
return
|
|
8
|
+
let V = null;
|
|
9
|
+
function G() {
|
|
10
|
+
return V;
|
|
11
11
|
}
|
|
12
12
|
function we() {
|
|
13
|
-
return
|
|
13
|
+
return V ? Promise.resolve(V) : Z || (kt ? (Z = Promise.resolve(kt()).then((r) => (V = r, V)).catch((r) => {
|
|
14
14
|
throw Z = null, r;
|
|
15
15
|
}), Z) : Promise.reject(
|
|
16
16
|
new Error(
|
|
@@ -22,32 +22,32 @@ const Je = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
22
22
|
__proto__: null,
|
|
23
23
|
isCoreLoaded: Ze,
|
|
24
24
|
loadCore: we,
|
|
25
|
-
peekCore:
|
|
25
|
+
peekCore: G,
|
|
26
26
|
setCoreLoader: ye
|
|
27
27
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
28
|
-
function
|
|
28
|
+
function Ot(r) {
|
|
29
29
|
return { scale: r / 96, pxPerMm: r / 25.4 };
|
|
30
30
|
}
|
|
31
31
|
function ft(r) {
|
|
32
32
|
return typeof r?.paintCartograph == "function";
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const B = (r, t) => {
|
|
35
35
|
const e = r.getAttribute(t);
|
|
36
36
|
if (e == null || e.trim() === "") return null;
|
|
37
37
|
const n = Number(e);
|
|
38
38
|
return Number.isFinite(n) ? n : null;
|
|
39
39
|
};
|
|
40
|
-
function
|
|
40
|
+
function S(r) {
|
|
41
41
|
return {
|
|
42
|
-
x:
|
|
43
|
-
y:
|
|
44
|
-
w:
|
|
45
|
-
h:
|
|
46
|
-
rotation:
|
|
47
|
-
z:
|
|
42
|
+
x: B(r, "x") ?? 0,
|
|
43
|
+
y: B(r, "y") ?? 0,
|
|
44
|
+
w: B(r, "w") ?? 0,
|
|
45
|
+
h: B(r, "h") ?? 0,
|
|
46
|
+
rotation: B(r, "rotation") ?? 0,
|
|
47
|
+
z: B(r, "z")
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function $t(r, t = 0) {
|
|
51
51
|
if (!r) return t;
|
|
52
52
|
const e = Number.parseFloat(r);
|
|
53
53
|
return Number.isFinite(e) ? e : t;
|
|
@@ -57,7 +57,7 @@ function L(r) {
|
|
|
57
57
|
const t = r.trim().toLowerCase();
|
|
58
58
|
return t === "transparent" || t === "rgba(0, 0, 0, 0)" || t === "none" ? null : r;
|
|
59
59
|
}
|
|
60
|
-
const
|
|
60
|
+
const z = 96 / 25.4, Ut = {
|
|
61
61
|
A0: { widthMm: 841, heightMm: 1189 },
|
|
62
62
|
A1: { widthMm: 594, heightMm: 841 },
|
|
63
63
|
A2: { widthMm: 420, heightMm: 594 },
|
|
@@ -66,25 +66,25 @@ const W = 96 / 25.4, Ot = {
|
|
|
66
66
|
A5: { widthMm: 148, heightMm: 210 },
|
|
67
67
|
Letter: { widthMm: 215.9, heightMm: 279.4 },
|
|
68
68
|
Legal: { widthMm: 215.9, heightMm: 355.6 }
|
|
69
|
-
},
|
|
69
|
+
}, zt = "A4";
|
|
70
70
|
function ct(r, t, e, n) {
|
|
71
71
|
const i = t != null ? Number(t) : NaN, s = e != null ? Number(e) : NaN;
|
|
72
72
|
if (Number.isFinite(i) && i > 0 && Number.isFinite(s) && s > 0) return { widthMm: i, heightMm: s };
|
|
73
|
-
const o =
|
|
73
|
+
const o = Ut[r ?? zt] ?? Ut[zt];
|
|
74
74
|
return n === "landscape" ? { widthMm: o.heightMm, heightMm: o.widthMm } : { ...o };
|
|
75
75
|
}
|
|
76
|
-
let
|
|
76
|
+
let et = null;
|
|
77
77
|
function Qe(r) {
|
|
78
|
-
if (!
|
|
79
|
-
|
|
78
|
+
if (!et) {
|
|
79
|
+
et = new Uint32Array(256);
|
|
80
80
|
for (let e = 0; e < 256; e++) {
|
|
81
81
|
let n = e;
|
|
82
82
|
for (let i = 0; i < 8; i++) n = n & 1 ? 3988292384 ^ n >>> 1 : n >>> 1;
|
|
83
|
-
|
|
83
|
+
et[e] = n >>> 0;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
86
|
let t = 4294967295;
|
|
87
|
-
for (let e = 0; e < r.length; e++) t =
|
|
87
|
+
for (let e = 0; e < r.length; e++) t = et[(t ^ r[e]) & 255] ^ t >>> 8;
|
|
88
88
|
return (t ^ 4294967295) >>> 0;
|
|
89
89
|
}
|
|
90
90
|
function tr(r) {
|
|
@@ -109,25 +109,25 @@ async function er(r, t = /* @__PURE__ */ new Date()) {
|
|
|
109
109
|
const c = new DataView(new ArrayBuffer(22));
|
|
110
110
|
return c.setUint32(0, 101010256, !0), c.setUint16(4, 0, !0), c.setUint16(6, 0, !0), c.setUint16(8, o.length, !0), c.setUint16(10, o.length, !0), c.setUint32(12, a - l, !0), c.setUint32(16, l, !0), c.setUint16(20, 0, !0), s.push(new Uint8Array(c.buffer)), new Blob(s, { type: "application/zip" });
|
|
111
111
|
}
|
|
112
|
-
const dt = ["protanopia", "deuteranopia", "tritanopia", "achromatopsia"],
|
|
112
|
+
const dt = ["protanopia", "deuteranopia", "tritanopia", "achromatopsia"], ve = {
|
|
113
113
|
protan: "protanopia",
|
|
114
114
|
deutan: "deuteranopia",
|
|
115
115
|
tritan: "tritanopia",
|
|
116
116
|
achroma: "achromatopsia"
|
|
117
117
|
};
|
|
118
|
-
function
|
|
118
|
+
function Ft(r) {
|
|
119
119
|
const t = r?.trim().toLowerCase();
|
|
120
|
-
return !t || t === "none" ? null : dt.includes(t) ? t :
|
|
120
|
+
return !t || t === "none" ? null : dt.includes(t) ? t : ve[t] ?? null;
|
|
121
121
|
}
|
|
122
|
-
const rr = ["none", ...dt, ...Object.keys(
|
|
122
|
+
const rr = ["none", ...dt, ...Object.keys(ve)], It = {
|
|
123
123
|
protanopia: [0.11238, 0.88762, 0, 0.11238, 0.88762, 0, 401e-5, -401e-5, 1],
|
|
124
124
|
deuteranopia: [0.29275, 0.70725, 0, 0.29275, 0.70725, 0, -0.02234, 0.02234, 1],
|
|
125
125
|
tritanopia: [1, 0.14461, -0.14461, 0, 0.85659, 0.14341, 0, 0.85659, 0.14341],
|
|
126
126
|
achromatopsia: [0.2126, 0.7152, 0.0722, 0.2126, 0.7152, 0.0722, 0.2126, 0.7152, 0.0722]
|
|
127
|
-
},
|
|
127
|
+
}, q = (r) => {
|
|
128
128
|
const t = r / 255;
|
|
129
129
|
return t <= 0.04045 ? t / 12.92 : ((t + 0.055) / 1.055) ** 2.4;
|
|
130
|
-
},
|
|
130
|
+
}, lt = (r) => {
|
|
131
131
|
const t = Math.min(1, Math.max(0, r));
|
|
132
132
|
return 255 * (t <= 31308e-7 ? t * 12.92 : 1.055 * t ** (1 / 2.4) - 0.055);
|
|
133
133
|
};
|
|
@@ -141,30 +141,30 @@ function nr(r) {
|
|
|
141
141
|
return n ? { r: Number(n[1]), g: Number(n[2]), b: Number(n[3]) } : null;
|
|
142
142
|
}
|
|
143
143
|
function jt(r, t) {
|
|
144
|
-
const e =
|
|
144
|
+
const e = It[t], [n, i, s] = [q(r.r), q(r.g), q(r.b)];
|
|
145
145
|
return {
|
|
146
|
-
r:
|
|
147
|
-
g:
|
|
148
|
-
b:
|
|
146
|
+
r: lt(e[0] * n + e[1] * i + e[2] * s),
|
|
147
|
+
g: lt(e[3] * n + e[4] * i + e[5] * s),
|
|
148
|
+
b: lt(e[6] * n + e[7] * i + e[8] * s)
|
|
149
149
|
};
|
|
150
150
|
}
|
|
151
|
-
function
|
|
152
|
-
const [n, i, s] = [
|
|
151
|
+
function Dt({ r, g: t, b: e }) {
|
|
152
|
+
const [n, i, s] = [q(r), q(t), q(e)], o = (n * 0.4124564 + i * 0.3575761 + s * 0.1804375) / 0.95047, a = n * 0.2126729 + i * 0.7151522 + s * 0.072175, l = (n * 0.0193339 + i * 0.119192 + s * 0.9503041) / 1.08883, c = (h) => h > 216 / 24389 ? Math.cbrt(h) : 841 / 108 * h + 4 / 29, [u, m, d] = [c(o), c(a), c(l)];
|
|
153
153
|
return [116 * m - 16, 500 * (u - m), 200 * (m - d)];
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
const [e, n, i] =
|
|
157
|
-
if (U === 0 &&
|
|
158
|
-
const X = Math.atan2(
|
|
155
|
+
function Gt(r, t) {
|
|
156
|
+
const [e, n, i] = Dt(r), [s, o, a] = Dt(t), l = Math.PI / 180, c = 180 / Math.PI, u = (Math.hypot(n, i) + Math.hypot(o, a)) / 2, m = 0.5 * (1 - Math.sqrt(u ** 7 / (u ** 7 + 25 ** 7))), [d, h] = [n * (1 + m), o * (1 + m)], [f, p] = [Math.hypot(d, i), Math.hypot(h, a)], g = (U, tt) => {
|
|
157
|
+
if (U === 0 && tt === 0) return 0;
|
|
158
|
+
const X = Math.atan2(tt, U) * c;
|
|
159
159
|
return X >= 0 ? X : X + 360;
|
|
160
|
-
}, [b, w] = [g(d, i), g(h, a)], y = s - e,
|
|
161
|
-
let
|
|
162
|
-
f * p !== 0 && (
|
|
163
|
-
const F = 2 * Math.sqrt(f * p) * Math.sin(
|
|
160
|
+
}, [b, w] = [g(d, i), g(h, a)], y = s - e, C = p - f;
|
|
161
|
+
let v = 0;
|
|
162
|
+
f * p !== 0 && (v = w - b, v > 180 ? v -= 360 : v < -180 && (v += 360));
|
|
163
|
+
const F = 2 * Math.sqrt(f * p) * Math.sin(v * l / 2), _ = (e + s) / 2, k = (f + p) / 2;
|
|
164
164
|
let N = b + w;
|
|
165
165
|
f * p !== 0 && (Math.abs(b - w) > 180 && (N += b + w < 360 ? 360 : -360), N /= 2);
|
|
166
|
-
const T = 1 - 0.17 * Math.cos((N - 30) * l) + 0.24 * Math.cos(2 * N * l) + 0.32 * Math.cos((3 * N + 6) * l) - 0.2 * Math.cos((4 * N - 63) * l),
|
|
167
|
-
return Math.sqrt((y /
|
|
166
|
+
const T = 1 - 0.17 * Math.cos((N - 30) * l) + 0.24 * Math.cos(2 * N * l) + 0.32 * Math.cos((3 * N + 6) * l) - 0.2 * Math.cos((4 * N - 63) * l), M = 1 + 0.015 * (_ - 50) ** 2 / Math.sqrt(20 + (_ - 50) ** 2), A = 1 + 0.045 * k, $ = 1 + 0.015 * k * T, E = -2 * Math.sqrt(k ** 7 / (k ** 7 + 25 ** 7)) * Math.sin(60 * Math.exp(-(((N - 275) / 25) ** 2)) * l);
|
|
167
|
+
return Math.sqrt((y / M) ** 2 + (C / A) ** 2 + (F / $) ** 2 + E * (C / A) * (F / $));
|
|
168
168
|
}
|
|
169
169
|
const ir = 10;
|
|
170
170
|
function or(r, t = ir) {
|
|
@@ -180,8 +180,8 @@ function or(r, t = ir) {
|
|
|
180
180
|
for (const l of e.values())
|
|
181
181
|
for (let c = 0; c < l.length; c++)
|
|
182
182
|
for (let u = c + 1; u < l.length; u++) {
|
|
183
|
-
if (
|
|
184
|
-
const d =
|
|
183
|
+
if (Gt(l[c].rgb, l[u].rgb) < t) continue;
|
|
184
|
+
const d = Gt(jt(l[c].rgb, a), jt(l[u].rgb, a));
|
|
185
185
|
d < t && (n.push({ type: a, a: l[c].entry, b: l[u].entry, distance: d }), i.set(a, (i.get(a) ?? 0) + 1));
|
|
186
186
|
}
|
|
187
187
|
let s = null, o = 0;
|
|
@@ -198,30 +198,30 @@ function sr(r, t, e, n) {
|
|
|
198
198
|
return !1;
|
|
199
199
|
}
|
|
200
200
|
const s = new Float64Array(256);
|
|
201
|
-
for (let m = 0; m < 256; m++) s[m] =
|
|
201
|
+
for (let m = 0; m < 256; m++) s[m] = q(m);
|
|
202
202
|
const o = 1024, a = new Float64Array(o + 1);
|
|
203
|
-
for (let m = 0; m <= o; m++) a[m] =
|
|
203
|
+
for (let m = 0; m <= o; m++) a[m] = lt(m / o);
|
|
204
204
|
const l = (m) => {
|
|
205
205
|
const d = Math.min(1, Math.max(0, m)) * o, h = Math.floor(d);
|
|
206
206
|
return h >= o ? a[o] : a[h] + (a[h + 1] - a[h]) * (d - h);
|
|
207
|
-
}, c =
|
|
207
|
+
}, c = It[n], u = i.data;
|
|
208
208
|
for (let m = 0; m < u.length; m += 4) {
|
|
209
209
|
const d = s[u[m]], h = s[u[m + 1]], f = s[u[m + 2]];
|
|
210
210
|
u[m] = l(c[0] * d + c[1] * h + c[2] * f), u[m + 1] = l(c[3] * d + c[4] * h + c[5] * f), u[m + 2] = l(c[6] * d + c[7] * h + c[8] * f);
|
|
211
211
|
}
|
|
212
212
|
return r.putImageData(i, 0, 0), !0;
|
|
213
213
|
}
|
|
214
|
-
const
|
|
214
|
+
const Me = (r) => `om-carto-cvd-${r}`;
|
|
215
215
|
function ar(r) {
|
|
216
216
|
if (r.getElementById("om-carto-cvd-filters")) return;
|
|
217
217
|
const t = r.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
218
218
|
t.id = "om-carto-cvd-filters", t.setAttribute("aria-hidden", "true"), t.setAttribute("width", "0"), t.setAttribute("height", "0"), t.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;";
|
|
219
219
|
for (const e of dt) {
|
|
220
220
|
const n = r.createElementNS("http://www.w3.org/2000/svg", "filter");
|
|
221
|
-
n.id =
|
|
221
|
+
n.id = Me(e), n.setAttribute("color-interpolation-filters", "linearRGB");
|
|
222
222
|
const i = r.createElementNS("http://www.w3.org/2000/svg", "feColorMatrix");
|
|
223
223
|
i.setAttribute("type", "matrix");
|
|
224
|
-
const s =
|
|
224
|
+
const s = It[e];
|
|
225
225
|
i.setAttribute("values", [s[0], s[1], s[2], 0, 0, s[3], s[4], s[5], 0, 0, s[6], s[7], s[8], 0, 0, 0, 0, 0, 1, 0].join(" ")), n.appendChild(i), t.appendChild(n);
|
|
226
226
|
}
|
|
227
227
|
r.body.appendChild(t);
|
|
@@ -243,9 +243,9 @@ async function lr(r) {
|
|
|
243
243
|
function cr(r) {
|
|
244
244
|
return [...r.children].filter(
|
|
245
245
|
(t) => !t.hasAttribute("hidden") && !t.hasAttribute("data-om-carto-marks") && !t.hasAttribute("data-om-carto-flattened") && t.tagName.toLowerCase() !== "style" && t.tagName.toLowerCase() !== "script"
|
|
246
|
-
).map((t, e) => ({ el: t, index: e, z:
|
|
246
|
+
).map((t, e) => ({ el: t, index: e, z: S(t).z ?? 0 })).sort((t, e) => t.z - e.z || t.index - e.index).map((t) => t.el);
|
|
247
247
|
}
|
|
248
|
-
async function
|
|
248
|
+
async function Rt(r, t = {}) {
|
|
249
249
|
const e = r ?? document.querySelector("om-cartograph");
|
|
250
250
|
if (!e) throw new Error("[onlymapjs/cartograph] renderCartograph: no <om-cartograph> to render.");
|
|
251
251
|
const n = [], i = t.dpi ?? (Number(e.getAttribute("dpi")) || 300);
|
|
@@ -259,45 +259,45 @@ async function It(r, t = {}) {
|
|
|
259
259
|
let d = i;
|
|
260
260
|
const h = Math.min(u / (l / 25.4), u / (c / 25.4)), f = Math.sqrt(m / (l / 25.4 * (c / 25.4))), p = Math.min(h, f);
|
|
261
261
|
d > p && (d = Math.floor(p), n.push(`Requested ${i} dpi exceeds this browser's canvas budget for a ${l.toFixed(0)}×${c.toFixed(0)}mm page; rendered at ${d} dpi instead.`)), n.push(...await lr(e)), typeof document < "u" && document.fonts?.ready && await document.fonts.ready;
|
|
262
|
-
const g =
|
|
263
|
-
for (const
|
|
264
|
-
if (!(!ft(
|
|
262
|
+
const g = Ot(d), b = Math.max(1, Math.round(l * g.pxPerMm)), w = Math.max(1, Math.round(c * g.pxPerMm)), y = cr(e);
|
|
263
|
+
for (const M of y)
|
|
264
|
+
if (!(!ft(M) || !M.prepareCartograph))
|
|
265
265
|
try {
|
|
266
|
-
await
|
|
266
|
+
await M.prepareCartograph(Ot(d));
|
|
267
267
|
} catch (A) {
|
|
268
|
-
|
|
268
|
+
M.discardCartograph?.(), n.push(`${M.tagName.toLowerCase()}${M.id ? `#${M.id}` : ""} could not be captured: ${A.message}`);
|
|
269
269
|
}
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
const
|
|
273
|
-
if (!
|
|
270
|
+
const C = document.createElement("canvas");
|
|
271
|
+
C.width = b, C.height = w;
|
|
272
|
+
const v = C.getContext("2d");
|
|
273
|
+
if (!v) throw new Error("[onlymapjs/cartograph] renderCartograph: could not get a 2D canvas context.");
|
|
274
274
|
const F = typeof getComputedStyle == "function" ? getComputedStyle(e) : null;
|
|
275
|
-
|
|
276
|
-
for (const
|
|
277
|
-
if (!ft(
|
|
278
|
-
const A =
|
|
279
|
-
if (
|
|
280
|
-
const
|
|
281
|
-
|
|
275
|
+
v.fillStyle = L(F?.backgroundColor) ?? "#ffffff", v.fillRect(0, 0, b, w);
|
|
276
|
+
for (const M of y) {
|
|
277
|
+
if (!ft(M)) continue;
|
|
278
|
+
const A = S(M);
|
|
279
|
+
if (v.save(), v.translate((A.x + a) * g.pxPerMm, (A.y + a) * g.pxPerMm), A.rotation) {
|
|
280
|
+
const $ = A.w / 2 * g.pxPerMm, E = A.h / 2 * g.pxPerMm;
|
|
281
|
+
v.translate($, E), v.rotate(A.rotation * Math.PI / 180), v.translate(-$, -E);
|
|
282
282
|
}
|
|
283
283
|
try {
|
|
284
|
-
|
|
285
|
-
} catch (
|
|
286
|
-
n.push(`${
|
|
284
|
+
M.paintCartograph(v, g);
|
|
285
|
+
} catch ($) {
|
|
286
|
+
n.push(`${M.tagName.toLowerCase()}${M.id ? `#${M.id}` : ""} failed to render: ${$.message}`);
|
|
287
287
|
}
|
|
288
|
-
|
|
288
|
+
v.restore();
|
|
289
289
|
}
|
|
290
290
|
const _ = e.querySelector(":scope > [data-om-carto-marks]");
|
|
291
|
-
for (const
|
|
292
|
-
const A = Number(
|
|
293
|
-
[A,
|
|
291
|
+
for (const M of _?.querySelectorAll("line") ?? []) {
|
|
292
|
+
const A = Number(M.getAttribute("x1")), $ = Number(M.getAttribute("y1")), E = Number(M.getAttribute("x2")), U = Number(M.getAttribute("y2"));
|
|
293
|
+
[A, $, E, U].every(Number.isFinite) && (v.save(), v.strokeStyle = M.getAttribute("stroke") || "#000000", v.lineWidth = (Number(M.getAttribute("stroke-width")) || 0.2) * g.pxPerMm, v.beginPath(), v.moveTo((A + a) * g.pxPerMm, ($ + a) * g.pxPerMm), v.lineTo((E + a) * g.pxPerMm, (U + a) * g.pxPerMm), v.stroke(), v.restore());
|
|
294
294
|
}
|
|
295
|
-
const
|
|
296
|
-
|
|
297
|
-
for (const
|
|
295
|
+
const k = Ft(t.cvd === "page" ? e.getAttribute("cvd") : t.cvd);
|
|
296
|
+
k && !sr(v, b, w, k) && n.push("Colour-vision simulation was skipped: a cross-origin image on the page makes the export canvas unreadable.");
|
|
297
|
+
for (const M of y) ft(M) && M.discardCartograph?.();
|
|
298
298
|
const N = t.format === "jpeg" ? "image/jpeg" : "image/png";
|
|
299
299
|
N === "image/jpeg" && e.querySelector("om-text") && n.push("JPEG compresses text edges — prefer PNG for a page carrying labels.");
|
|
300
|
-
const T = await new Promise((
|
|
300
|
+
const T = await new Promise((M) => C.toBlob(M, N, t.quality));
|
|
301
301
|
if (!T) throw new Error("[onlymapjs/cartograph] renderCartograph: the canvas produced no image (it may have exceeded a browser limit).");
|
|
302
302
|
return { blob: T, widthPx: b, heightPx: w, dpi: d, warnings: n };
|
|
303
303
|
}
|
|
@@ -317,14 +317,14 @@ async function Ce(r, t = {}) {
|
|
|
317
317
|
if (!Number.isInteger(m) || m < 0 || m >= i)
|
|
318
318
|
throw new Error(`[onlymapjs/cartograph] renderCartographAtlas: page ${t.page} is out of range (this atlas has ${i}).`);
|
|
319
319
|
n.seek(m);
|
|
320
|
-
const d = await
|
|
320
|
+
const d = await qt(e, t, a);
|
|
321
321
|
return { blob: d.blob, filenames: [o[m]], pages: 1, dpi: d.dpi, warnings: a };
|
|
322
322
|
}
|
|
323
323
|
const c = [];
|
|
324
324
|
let u = t.dpi ?? 300;
|
|
325
325
|
for (let m = 0; m < i; m++) {
|
|
326
326
|
n.seek(m);
|
|
327
|
-
const d = await
|
|
327
|
+
const d = await qt(e, t, a);
|
|
328
328
|
u = d.dpi, c.push({ name: o[m], data: d.blob }), t.onPage?.(m + 1, i);
|
|
329
329
|
}
|
|
330
330
|
return { blob: await er(c), filenames: o, pages: i, dpi: u, warnings: a };
|
|
@@ -332,27 +332,27 @@ async function Ce(r, t = {}) {
|
|
|
332
332
|
n.seek(l);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
|
-
async function
|
|
335
|
+
async function qt(r, t, e) {
|
|
336
336
|
for (const i of r.querySelectorAll("om-frame"))
|
|
337
337
|
await i.mapElement?.whenSettled?.({ timeout: 2e4 });
|
|
338
|
-
const n = await
|
|
338
|
+
const n = await Rt(r, t);
|
|
339
339
|
return e.push(...n.warnings), n;
|
|
340
340
|
}
|
|
341
341
|
const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
342
342
|
__proto__: null,
|
|
343
343
|
MAX_CANVAS_AREA: Se,
|
|
344
344
|
MAX_CANVAS_DIMENSION: Ae,
|
|
345
|
-
renderCartograph:
|
|
345
|
+
renderCartograph: Rt,
|
|
346
346
|
renderCartographAtlas: Ce
|
|
347
347
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
348
|
-
function
|
|
348
|
+
function Wt(r, t, e = {}) {
|
|
349
349
|
const n = URL.createObjectURL(r), i = document.createElement("a");
|
|
350
350
|
i.href = n, i.download = t, document.body.appendChild(i), i.click(), i.remove();
|
|
351
351
|
const s = e.revokeAfterMs ?? 0;
|
|
352
352
|
s > 0 ? setTimeout(() => URL.revokeObjectURL(n), s) : URL.revokeObjectURL(n);
|
|
353
353
|
}
|
|
354
354
|
const hr = 3e4;
|
|
355
|
-
async function
|
|
355
|
+
async function Bt(r, t = hr) {
|
|
356
356
|
let e = !1;
|
|
357
357
|
const n = new Promise(
|
|
358
358
|
(s) => setTimeout(() => {
|
|
@@ -380,7 +380,7 @@ async function mr(r, t = {}) {
|
|
|
380
380
|
i && r.setAttribute("cvd", i);
|
|
381
381
|
const s = n.get("export");
|
|
382
382
|
if (s) {
|
|
383
|
-
await
|
|
383
|
+
await Bt(r, t.timeoutMs);
|
|
384
384
|
const o = s === "jpeg" ? "jpeg" : "png", a = Number(n.get("dpi")) || void 0, l = r.getAttribute("cartograph-id") || "cartograph", c = n.get("page");
|
|
385
385
|
if (c != null) {
|
|
386
386
|
const m = r.querySelector("om-atlas");
|
|
@@ -390,13 +390,13 @@ async function mr(r, t = {}) {
|
|
|
390
390
|
m.refresh?.();
|
|
391
391
|
const h = await Ce(r, { dpi: a, format: o, page: d - 1 });
|
|
392
392
|
for (const f of h.warnings) console.warn(`[onlymapjs/cartograph] ${f}`);
|
|
393
|
-
return
|
|
393
|
+
return Wt(h.blob, h.filenames[0] ?? `${l}.${o === "jpeg" ? "jpg" : "png"}`, { revokeAfterMs: 1e4 }), "export";
|
|
394
394
|
}
|
|
395
|
-
const u = await
|
|
395
|
+
const u = await Rt(r, { dpi: a, format: o });
|
|
396
396
|
for (const m of u.warnings) console.warn(`[onlymapjs/cartograph] ${m}`);
|
|
397
|
-
return
|
|
397
|
+
return Wt(u.blob, `${l}.${o === "jpeg" ? "jpg" : "png"}`, { revokeAfterMs: 1e4 }), "export";
|
|
398
398
|
}
|
|
399
|
-
return n.get("print") === "1" ? (await
|
|
399
|
+
return n.get("print") === "1" ? (await Bt(r, t.timeoutMs), typeof r.print == "function" ? await r.print({ dpi: Number(n.get("dpi")) || void 0 }) : typeof window < "u" && window.print(), "print") : i ? "cvd" : null;
|
|
400
400
|
}
|
|
401
401
|
function dr() {
|
|
402
402
|
if (typeof document > "u") return;
|
|
@@ -450,7 +450,7 @@ class R extends fr {
|
|
|
450
450
|
a != null && Number.isInteger(a) ? this.style.zIndex = String(a) : this.style.removeProperty("z-index");
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
|
-
const pt = "cartograph/2",
|
|
453
|
+
const pt = "cartograph/2", Wn = ["default", "dark", "sepia", "blueprint", "minimal"], Vt = ["A0", "A1", "A2", "A3", "A4", "A5", "Letter", "Legal"], gr = /* @__PURE__ */ new Map([
|
|
454
454
|
["projection", "live frames render Web Mercator (EPSG:3857) only — Globe support is design-only; use a static frame for other projections"]
|
|
455
455
|
]), j = ["id", "x", "y", "w", "h", "rotation", "z", "locked", "hidden"], P = {
|
|
456
456
|
"om-cartograph": ["cartograph-id", "format", "size", "width", "height", "orientation", "theme", "title", "attribution", "notes", "cvd", "bleed", "crop-marks", "safe-zone", "dpi", "flatten", "color-profile", "allow-url-actions"],
|
|
@@ -468,16 +468,16 @@ const pt = "cartograph/2", qn = ["default", "dark", "sepia", "blueprint", "minim
|
|
|
468
468
|
"om-shape": [...j, "kind", "fill", "fill-opacity", "stroke", "stroke-width", "radius"],
|
|
469
469
|
"om-image": [...j, "src", "fit"],
|
|
470
470
|
"om-atlas": ["id", "for", "layer", "filter", "sort", "filename", "page-name"]
|
|
471
|
-
}, gt = Object.keys(P), br = ["metric", "imperial", "nautical"], yr = 0.3048, wr = 1609.344,
|
|
472
|
-
function
|
|
471
|
+
}, gt = Object.keys(P), br = ["metric", "imperial", "nautical"], yr = 0.3048, wr = 1609.344, vr = 1852;
|
|
472
|
+
function Mr(r) {
|
|
473
473
|
return r != null && br.includes(r) ? r : null;
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function ke(r) {
|
|
476
476
|
if (!isFinite(r) || r <= 0) return 0;
|
|
477
477
|
const t = Math.pow(10, Math.floor(Math.log10(r))), e = r / t;
|
|
478
478
|
return (e >= 5 ? 5 : e >= 2 ? 2 : 1) * t;
|
|
479
479
|
}
|
|
480
|
-
const
|
|
480
|
+
const Ht = {
|
|
481
481
|
// Finest first; the largest tier whose snapped length is ≥ 1 unit wins.
|
|
482
482
|
metric: [
|
|
483
483
|
{ metersPerUnit: 1, label: "m" },
|
|
@@ -487,17 +487,17 @@ const Vt = {
|
|
|
487
487
|
{ metersPerUnit: yr, label: "ft" },
|
|
488
488
|
{ metersPerUnit: wr, label: "mi" }
|
|
489
489
|
],
|
|
490
|
-
nautical: [{ metersPerUnit:
|
|
490
|
+
nautical: [{ metersPerUnit: vr, label: "nmi" }]
|
|
491
491
|
};
|
|
492
|
-
function
|
|
492
|
+
function $e({ groundMetersPerMm: r, maxWidthMm: t, segments: e = 4, units: n = "metric", segmentLengthMeters: i }) {
|
|
493
493
|
if (!Number.isFinite(r) || r <= 0 || !Number.isFinite(t) || t <= 0) return null;
|
|
494
|
-
const s = Number.isInteger(e) && e > 0 ? e : 4, o =
|
|
494
|
+
const s = Number.isInteger(e) && e > 0 ? e : 4, o = Ht[n] ?? Ht.metric, a = t / s * r;
|
|
495
495
|
let l, c;
|
|
496
496
|
if (i != null && Number.isFinite(i) && i > 0)
|
|
497
|
-
l = i, c =
|
|
497
|
+
l = i, c = Yt(o, l);
|
|
498
498
|
else {
|
|
499
|
-
c =
|
|
500
|
-
const f =
|
|
499
|
+
c = Yt(o, a);
|
|
500
|
+
const f = ke(a / c.metersPerUnit);
|
|
501
501
|
if (f <= 0) return null;
|
|
502
502
|
l = f * c.metersPerUnit;
|
|
503
503
|
}
|
|
@@ -558,7 +558,7 @@ function Ar(r, t, e) {
|
|
|
558
558
|
}
|
|
559
559
|
return { bars: c, strokes: u, labels: f, fontMm: n, strokeMm: i, segmentMeters: r.segmentMeters, unitLabel: r.unitLabel, scaleDenominator: r.scaleDenominator };
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Yt(r, t) {
|
|
562
562
|
let e = r[0];
|
|
563
563
|
for (const n of r)
|
|
564
564
|
t / n.metersPerUnit >= 1 && (e = n);
|
|
@@ -588,11 +588,11 @@ function Ne(r, t) {
|
|
|
588
588
|
return o === void 0 ? (e.push(s), i) : o;
|
|
589
589
|
}), unresolved: e };
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function kr(r) {
|
|
592
592
|
return [...r.matchAll(Ee)].map((t) => t[1]);
|
|
593
593
|
}
|
|
594
|
-
const
|
|
595
|
-
function
|
|
594
|
+
const Kt = /* @__PURE__ */ new WeakMap();
|
|
595
|
+
function $r(r, t) {
|
|
596
596
|
const e = [], n = r.ownerDocument ?? (typeof document < "u" ? document : null);
|
|
597
597
|
if (!n) return e;
|
|
598
598
|
const i = n.createTreeWalker(
|
|
@@ -602,10 +602,10 @@ function kr(r, t) {
|
|
|
602
602
|
), s = [];
|
|
603
603
|
for (let o = i.nextNode(); o; o = i.nextNode()) s.push(o);
|
|
604
604
|
for (const o of s) {
|
|
605
|
-
let a =
|
|
605
|
+
let a = Kt.get(o);
|
|
606
606
|
if (a === void 0) {
|
|
607
607
|
if (a = o.data, !a.includes("{{")) continue;
|
|
608
|
-
|
|
608
|
+
Kt.set(o, a);
|
|
609
609
|
}
|
|
610
610
|
const l = Ne(a, t);
|
|
611
611
|
o.data !== l.text && (o.data = l.text), e.push(...l.unresolved);
|
|
@@ -639,7 +639,7 @@ function O(r) {
|
|
|
639
639
|
const t = r.getAttribute("for");
|
|
640
640
|
return t ? Te(r, t) : Nr(r);
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function W(r, t) {
|
|
643
643
|
let e = r.querySelector(`:scope > [${Et}]`);
|
|
644
644
|
if (!e) {
|
|
645
645
|
for (const n of [...r.children])
|
|
@@ -651,7 +651,7 @@ function G(r, t) {
|
|
|
651
651
|
function Pr(r) {
|
|
652
652
|
r.querySelector(`:scope > [${Et}]`)?.remove();
|
|
653
653
|
}
|
|
654
|
-
const
|
|
654
|
+
const Xt = "data-om-carto-page", Zt = "data-om-carto-marks", bt = "data-om-carto-credit", yt = "Built with OnlyMap by NIKA · free for non-commercial use", rt = 2, Jt = 1.2, wt = 2.4, Qt = 1.5, vt = 1.2, te = 0.3, ee = 0.8, Mt = "http://www.w3.org/2000/svg", Tr = 6e4;
|
|
655
655
|
class Fe extends R {
|
|
656
656
|
static observedAttributes = [...P["om-cartograph"]];
|
|
657
657
|
frameListenerBound = !1;
|
|
@@ -689,7 +689,7 @@ class Fe extends R {
|
|
|
689
689
|
* runtime's job (issue #41 §9: the om-map carries the key).
|
|
690
690
|
*/
|
|
691
691
|
renderCredit() {
|
|
692
|
-
const t =
|
|
692
|
+
const t = G();
|
|
693
693
|
t && !this.unsubscribeLicense && typeof t.subscribeLicense == "function" && (this.unsubscribeLicense = t.subscribeLicense(() => this.renderCredit()));
|
|
694
694
|
const e = t ? t.getEntitlements().hideBadge : !1, n = [...this.querySelectorAll("om-text")].some((o) => /onlymap/i.test(o.textContent ?? "")), i = this.querySelector(`:scope > [${bt}]`);
|
|
695
695
|
if (e || n) {
|
|
@@ -701,15 +701,15 @@ class Fe extends R {
|
|
|
701
701
|
return;
|
|
702
702
|
}
|
|
703
703
|
const s = this.ownerDocument.createElement("div");
|
|
704
|
-
s.setAttribute(bt, ""), s.setAttribute("z", "2147483644"), s.textContent = yt, s.style.cssText = `position:absolute;left:${
|
|
704
|
+
s.setAttribute(bt, ""), s.setAttribute("z", "2147483644"), s.textContent = yt, s.style.cssText = `position:absolute;left:${rt}mm;bottom:${Jt}mm;z-index:2147483644;font:${wt}mm/${Qt} system-ui,sans-serif;color:#374151;background:rgba(255,255,255,.72);padding:${te}mm ${vt}mm;border-radius:${ee}mm;pointer-events:none;`, this.armCreditPainter(s), this.appendChild(s);
|
|
705
705
|
}
|
|
706
706
|
/** Give the runtime-owned DOM credit the same canvas paint contract as authored furniture. */
|
|
707
707
|
armCreditPainter(t) {
|
|
708
708
|
t.paintCartograph = (e, n) => {
|
|
709
|
-
const i = (c) => c * n.pxPerMm, o = wt *
|
|
709
|
+
const i = (c) => c * n.pxPerMm, o = wt * Qt + te * 2, a = this.pageSize.heightMm - Jt - o;
|
|
710
710
|
e.save(), e.font = `${i(wt)}px system-ui, sans-serif`;
|
|
711
|
-
const l = e.measureText(yt).width / n.pxPerMm +
|
|
712
|
-
e.fillStyle = "rgba(255,255,255,.72)", e.beginPath(), typeof e.roundRect == "function" ? e.roundRect(i(
|
|
711
|
+
const l = e.measureText(yt).width / n.pxPerMm + vt * 2;
|
|
712
|
+
e.fillStyle = "rgba(255,255,255,.72)", e.beginPath(), typeof e.roundRect == "function" ? e.roundRect(i(rt), i(a), i(l), i(o), i(ee)) : e.rect(i(rt), i(a), i(l), i(o)), e.fill(), e.fillStyle = "#374151", e.textAlign = "left", e.textBaseline = "middle", e.fillText(yt, i(rt + vt), i(a + o / 2)), e.restore();
|
|
713
713
|
};
|
|
714
714
|
}
|
|
715
715
|
/**
|
|
@@ -795,8 +795,8 @@ class Fe extends R {
|
|
|
795
795
|
renderNow() {
|
|
796
796
|
const { widthMm: t, heightMm: e } = this.pageSize, n = this.bleedMm;
|
|
797
797
|
this.style.display = "block", this.style.position = "relative", this.style.width = `${t}mm`, this.style.height = `${e}mm`, this.style.margin = n > 0 ? `${n}mm` : "", this.style.overflow = n > 0 ? "visible" : "hidden";
|
|
798
|
-
let i = this.querySelector(`style[${
|
|
799
|
-
i || (i = document.createElement("style"), i.setAttribute(
|
|
798
|
+
let i = this.querySelector(`style[${Xt}]`);
|
|
799
|
+
i || (i = document.createElement("style"), i.setAttribute(Xt, ""), this.prepend(i));
|
|
800
800
|
const s = t + n * 2, o = e + n * 2;
|
|
801
801
|
i.textContent = `@page { size: ${s}mm ${o}mm; margin: 0; }
|
|
802
802
|
@media print { html, body { margin: 0; padding: 0; } om-cartograph { break-after: page; } }`, this.renderPrintMarks(t, e, n), this.applyCvd(), this.refreshTokens(), this.renderCredit();
|
|
@@ -811,13 +811,13 @@ class Fe extends R {
|
|
|
811
811
|
* worse than no guide.
|
|
812
812
|
*/
|
|
813
813
|
renderPrintMarks(t, e, n) {
|
|
814
|
-
const i = this.hasAttribute("crop-marks") && n > 0, s = Number(this.getAttribute("safe-zone")), o = Number.isFinite(s) && s > 0, a = this.querySelector(`:scope > [${
|
|
814
|
+
const i = this.hasAttribute("crop-marks") && n > 0, s = Number(this.getAttribute("safe-zone")), o = Number.isFinite(s) && s > 0, a = this.querySelector(`:scope > [${Zt}]`);
|
|
815
815
|
if (!i && !o) {
|
|
816
816
|
a?.remove();
|
|
817
817
|
return;
|
|
818
818
|
}
|
|
819
|
-
const l = this.ownerDocument, c = a ?? l.createElementNS(
|
|
820
|
-
if (c.setAttribute(
|
|
819
|
+
const l = this.ownerDocument, c = a ?? l.createElementNS(Mt, "svg");
|
|
820
|
+
if (c.setAttribute(Zt, ""), c.setAttribute("viewBox", `${-n} ${-n} ${t + n * 2} ${e + n * 2}`), c.setAttribute("width", `${t + n * 2}mm`), c.setAttribute("height", `${e + n * 2}mm`), c.style.cssText = `position:absolute;left:${-n}mm;top:${-n}mm;pointer-events:none;z-index:2147483646;`, c.replaceChildren(), i) {
|
|
821
821
|
const u = Math.min(n, 4), m = Math.min(n * 0.35, 1.5), d = [];
|
|
822
822
|
for (const h of [0, t])
|
|
823
823
|
for (const f of [0, e]) {
|
|
@@ -825,12 +825,12 @@ class Fe extends R {
|
|
|
825
825
|
d.push([h + p * m, f, h + p * (m + u), f]), d.push([h, f + g * m, h, f + g * (m + u)]);
|
|
826
826
|
}
|
|
827
827
|
for (const [h, f, p, g] of d) {
|
|
828
|
-
const b = l.createElementNS(
|
|
828
|
+
const b = l.createElementNS(Mt, "line");
|
|
829
829
|
b.setAttribute("x1", String(h)), b.setAttribute("y1", String(f)), b.setAttribute("x2", String(p)), b.setAttribute("y2", String(g)), b.setAttribute("stroke", "#000"), b.setAttribute("stroke-width", "0.15"), c.appendChild(b);
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
832
|
if (o) {
|
|
833
|
-
const u = l.createElementNS(
|
|
833
|
+
const u = l.createElementNS(Mt, "rect");
|
|
834
834
|
u.setAttribute("x", String(s)), u.setAttribute("y", String(s)), u.setAttribute("width", String(Math.max(0, t - s * 2))), u.setAttribute("height", String(Math.max(0, e - s * 2))), u.setAttribute("fill", "none"), u.setAttribute("stroke", "#22aaff"), u.setAttribute("stroke-width", "0.2"), u.setAttribute("stroke-dasharray", "2 1.5"), u.setAttribute("data-om-carto-screen-only", ""), c.appendChild(u);
|
|
835
835
|
}
|
|
836
836
|
a || this.appendChild(c);
|
|
@@ -844,12 +844,12 @@ class Fe extends R {
|
|
|
844
844
|
* injected only when a page actually asks for one.
|
|
845
845
|
*/
|
|
846
846
|
applyCvd() {
|
|
847
|
-
const t =
|
|
847
|
+
const t = Ft(this.getAttribute("cvd"));
|
|
848
848
|
if (!t) {
|
|
849
849
|
this.style.removeProperty("filter");
|
|
850
850
|
return;
|
|
851
851
|
}
|
|
852
|
-
ar(this.ownerDocument), this.style.filter = `url(#${
|
|
852
|
+
ar(this.ownerDocument), this.style.filter = `url(#${Me(t)})`;
|
|
853
853
|
}
|
|
854
854
|
}
|
|
855
855
|
x("om-cartograph", Fe);
|
|
@@ -883,7 +883,7 @@ function Lr({ text: r, maxWidth: t, fontSizePx: e, lineHeightPx: n, measure: i }
|
|
|
883
883
|
c.baselineY = a + u * s, c.width > l && (l = c.width);
|
|
884
884
|
}), { lines: o, lineHeight: s, maxWidth: l };
|
|
885
885
|
}
|
|
886
|
-
function
|
|
886
|
+
function Bn(r) {
|
|
887
887
|
if (typeof document > "u") return null;
|
|
888
888
|
const e = document.createElement("canvas").getContext("2d");
|
|
889
889
|
return e ? (e.font = r, (n) => e.measureText(n).width) : null;
|
|
@@ -911,16 +911,16 @@ class Ie extends R {
|
|
|
911
911
|
/** Re-run token substitution from the authored templates. */
|
|
912
912
|
resolveTokens() {
|
|
913
913
|
const t = this.closest("om-cartograph");
|
|
914
|
-
t && typeof t.tokenContext == "function" &&
|
|
914
|
+
t && typeof t.tokenContext == "function" && $r(this, t.tokenContext());
|
|
915
915
|
}
|
|
916
916
|
paintCartograph(t, e) {
|
|
917
|
-
const { w: n, h: i } =
|
|
917
|
+
const { w: n, h: i } = S(this), s = n * e.pxPerMm, o = i * e.pxPerMm;
|
|
918
918
|
if (s <= 0 || o <= 0) return;
|
|
919
919
|
const a = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, l = L(a?.backgroundColor);
|
|
920
920
|
l && (t.fillStyle = l, t.fillRect(0, 0, s, o));
|
|
921
921
|
const c = (this.textContent ?? "").trim();
|
|
922
922
|
if (c === "") return;
|
|
923
|
-
const u =
|
|
923
|
+
const u = $t(a?.fontSize, 12), m = a?.lineHeight === "normal" ? u * 1.4 : $t(a?.lineHeight, u * 1.4), d = a?.fontFamily || "system-ui, sans-serif", h = a?.fontWeight || "400", f = u * e.scale, p = m * e.scale, g = `${h} ${f}px ${d}`;
|
|
924
924
|
t.save(), t.font = g, t.fillStyle = L(a?.color) ?? "#000", t.textBaseline = "alphabetic", t.textAlign = "left";
|
|
925
925
|
const b = Lr({
|
|
926
926
|
text: c,
|
|
@@ -939,15 +939,15 @@ class Ie extends R {
|
|
|
939
939
|
x("om-text", Ie);
|
|
940
940
|
const Ir = 63710087714e-4;
|
|
941
941
|
let Rr = Ir;
|
|
942
|
-
const
|
|
942
|
+
const nt = Math.PI / 180;
|
|
943
943
|
function Re(r, t, e = Rr) {
|
|
944
|
-
const n = (t[1] - r[1]) *
|
|
944
|
+
const n = (t[1] - r[1]) * nt, i = (t[0] - r[0]) * nt, s = r[1] * nt, o = t[1] * nt, a = Math.sin(n / 2) ** 2 + Math.cos(s) * Math.cos(o) * Math.sin(i / 2) ** 2;
|
|
945
945
|
return 2 * e * Math.asin(Math.min(1, Math.sqrt(a)));
|
|
946
946
|
}
|
|
947
|
-
const ut = 6378137,
|
|
947
|
+
const ut = 6378137, re = Math.PI / 180, Nt = 180 / Math.PI, ne = 85.0511287798066;
|
|
948
948
|
function _r([r, t]) {
|
|
949
|
-
const e = Math.max(-
|
|
950
|
-
return [ut * r *
|
|
949
|
+
const e = Math.max(-ne, Math.min(ne, t));
|
|
950
|
+
return [ut * r * re, ut * Math.log(Math.tan(Math.PI / 4 + e * re / 2))];
|
|
951
951
|
}
|
|
952
952
|
function Or([r, t]) {
|
|
953
953
|
return [r / ut * Nt, (2 * Math.atan(Math.exp(t / ut)) - Math.PI / 2) * Nt];
|
|
@@ -967,7 +967,7 @@ function K(r) {
|
|
|
967
967
|
async function Oe(r, t) {
|
|
968
968
|
const e = K(r);
|
|
969
969
|
if (e && !t) return e;
|
|
970
|
-
const n = Y(r) ?? "EPSG:3857", i = t?.trim() || await
|
|
970
|
+
const n = Y(r) ?? "EPSG:3857", i = t?.trim() || await zr(n);
|
|
971
971
|
if (!i) return null;
|
|
972
972
|
const s = (await import("./index-CcLC9jE5.js")).default, a = s(i, "+proj=longlat +datum=WGS84 +no_defs");
|
|
973
973
|
return {
|
|
@@ -976,18 +976,18 @@ async function Oe(r, t) {
|
|
|
976
976
|
inverse: (l) => a.forward(l)
|
|
977
977
|
};
|
|
978
978
|
}
|
|
979
|
-
function
|
|
979
|
+
function ie(r, t) {
|
|
980
980
|
return !Number.isInteger(r) || r < 1 || r > 60 ? null : `+proj=utm +zone=${r}${t === "S" ? " +south" : ""} +datum=WGS84 +units=m +no_defs`;
|
|
981
981
|
}
|
|
982
|
-
async function
|
|
982
|
+
async function zr(r) {
|
|
983
983
|
const t = Number(/^EPSG:(\d+)$/.exec(r)?.[1]);
|
|
984
984
|
if (!Number.isFinite(t)) return null;
|
|
985
|
-
if (t >= 32601 && t <= 32660) return
|
|
986
|
-
if (t >= 32701 && t <= 32760) return
|
|
985
|
+
if (t >= 32601 && t <= 32660) return ie(t - 32600, "N");
|
|
986
|
+
if (t >= 32701 && t <= 32760) return ie(t - 32700, "S");
|
|
987
987
|
const { CRS_DEFS: e } = await import("./crs-DsDQ4Q4i.js");
|
|
988
988
|
return e[t]?.def ?? null;
|
|
989
989
|
}
|
|
990
|
-
function
|
|
990
|
+
function jr(r, t) {
|
|
991
991
|
const e = t.length, n = r.map((i, s) => [...i, t[s]]);
|
|
992
992
|
for (let i = 0; i < e; i++) {
|
|
993
993
|
let s = i;
|
|
@@ -1010,12 +1010,12 @@ function Dr(r, t) {
|
|
|
1010
1010
|
const [d, h] = o(r[m]), [f, p] = t[m];
|
|
1011
1011
|
a.push([d, h, 1, 0, 0, 0, -d * f, -h * f]), l.push(f), a.push([0, 0, 0, d, h, 1, -d * p, -h * p]), l.push(p);
|
|
1012
1012
|
}
|
|
1013
|
-
const c =
|
|
1013
|
+
const c = jr(a, l);
|
|
1014
1014
|
if (!c || c.some((m) => !Number.isFinite(m))) return null;
|
|
1015
1015
|
const u = (m) => [m[0] / s + e, m[1] / s + n];
|
|
1016
1016
|
return { matrix: [c[0], c[1], c[2], c[3], c[4], c[5], c[6], c[7], 1], normalize: o, denormalize: u };
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function oe(r, [t, e]) {
|
|
1019
1019
|
const n = r[6] * t + r[7] * e + r[8];
|
|
1020
1020
|
return Math.abs(n) < 1e-12 ? null : [(r[0] * t + r[1] * e + r[2]) / n, (r[3] * t + r[4] * e + r[5]) / n];
|
|
1021
1021
|
}
|
|
@@ -1033,7 +1033,7 @@ function Gr(r) {
|
|
|
1033
1033
|
(t * s - e * i) / u
|
|
1034
1034
|
];
|
|
1035
1035
|
}
|
|
1036
|
-
function
|
|
1036
|
+
function se(r, t) {
|
|
1037
1037
|
let e = r;
|
|
1038
1038
|
for (; e - t > 180; ) e -= 360;
|
|
1039
1039
|
for (; t - e > 180; ) e += 360;
|
|
@@ -1044,7 +1044,7 @@ const qr = (r) => {
|
|
|
1044
1044
|
return t === -180 && (t = 180), t;
|
|
1045
1045
|
};
|
|
1046
1046
|
function ht({ corners: r, widthMm: t, heightMm: e, crsForward: n }) {
|
|
1047
|
-
const i = n ?? _e, s = r[0][0], o = r.map(([h, f]) => [
|
|
1047
|
+
const i = n ?? _e, s = r[0][0], o = r.map(([h, f]) => [se(h, s), f]), a = o.map((h) => i.forward(h)), l = [
|
|
1048
1048
|
[0, 0],
|
|
1049
1049
|
[t, 0],
|
|
1050
1050
|
[t, e],
|
|
@@ -1057,12 +1057,12 @@ function ht({ corners: r, widthMm: t, heightMm: e, crsForward: n }) {
|
|
|
1057
1057
|
degenerate: m,
|
|
1058
1058
|
project(h) {
|
|
1059
1059
|
if (!c) return null;
|
|
1060
|
-
const f = i.forward([
|
|
1060
|
+
const f = i.forward([se(h[0], s), h[1]]), p = oe(c.matrix, c.normalize(f));
|
|
1061
1061
|
return p && Number.isFinite(p[0]) && Number.isFinite(p[1]) ? { xMm: p[0], yMm: p[1] } : null;
|
|
1062
1062
|
},
|
|
1063
1063
|
unproject(h, f) {
|
|
1064
1064
|
if (!c || !u) return null;
|
|
1065
|
-
const p =
|
|
1065
|
+
const p = oe(u, [h, f]);
|
|
1066
1066
|
if (!p) return null;
|
|
1067
1067
|
const g = i.inverse(c.denormalize(p));
|
|
1068
1068
|
return Number.isFinite(g[0]) && Number.isFinite(g[1]) ? [qr(g[0]), g[1]] : null;
|
|
@@ -1130,7 +1130,7 @@ function Br(r) {
|
|
|
1130
1130
|
const i = Math.min(...n), s = Math.max(...n);
|
|
1131
1131
|
return i > 0 ? (s - i) / i : null;
|
|
1132
1132
|
}
|
|
1133
|
-
function
|
|
1133
|
+
function Vn(r, t, e, n) {
|
|
1134
1134
|
return [
|
|
1135
1135
|
[r, n],
|
|
1136
1136
|
[e, n],
|
|
@@ -1170,7 +1170,7 @@ async function Yr(r, t = document) {
|
|
|
1170
1170
|
if (!o) throw new Error(`${r} could not be adopted`);
|
|
1171
1171
|
return o;
|
|
1172
1172
|
}
|
|
1173
|
-
function
|
|
1173
|
+
function Q(r) {
|
|
1174
1174
|
const t = r.getAttribute("center"), e = r.getAttribute("zoom");
|
|
1175
1175
|
if (!t || e == null || e.trim() === "") return null;
|
|
1176
1176
|
const n = Number(e);
|
|
@@ -1191,7 +1191,18 @@ function lt(r) {
|
|
|
1191
1191
|
pitch: Number(r.getAttribute("pitch")) || 0
|
|
1192
1192
|
};
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1194
|
+
function Kr(r, t, e, n, i = 60) {
|
|
1195
|
+
const s = (l) => Pt(r, { ...t, pitch: l }, e, n) !== null;
|
|
1196
|
+
if (s(i)) return i;
|
|
1197
|
+
if (!s(0)) return 0;
|
|
1198
|
+
let o = 0, a = i;
|
|
1199
|
+
for (; a - o > 1; ) {
|
|
1200
|
+
const l = Math.floor((o + a) / 2);
|
|
1201
|
+
s(l) ? o = l : a = l;
|
|
1202
|
+
}
|
|
1203
|
+
return o;
|
|
1204
|
+
}
|
|
1205
|
+
function Pt(r, t, e, n) {
|
|
1195
1206
|
if (!(e > 0) || !(n > 0)) return null;
|
|
1196
1207
|
const i = new r.WebMercatorViewport({
|
|
1197
1208
|
width: e,
|
|
@@ -1214,7 +1225,7 @@ function se(r, t, e, n) {
|
|
|
1214
1225
|
}
|
|
1215
1226
|
return o;
|
|
1216
1227
|
}
|
|
1217
|
-
async function
|
|
1228
|
+
async function Xr(r) {
|
|
1218
1229
|
const t = await we(), e = r.querySelector(":scope > om-map");
|
|
1219
1230
|
if (e) return { core: t, map: e };
|
|
1220
1231
|
const n = r.getAttribute("src");
|
|
@@ -1223,9 +1234,9 @@ async function Kr(r) {
|
|
|
1223
1234
|
return { core: t, map: i };
|
|
1224
1235
|
}
|
|
1225
1236
|
function At(r, t) {
|
|
1226
|
-
r.setAttribute("center", JSON.stringify(t.center)), r.setAttribute("zoom", String(t.zoom)), r.setAttribute("bearing", String(t.bearing)), r.setAttribute("pitch", String(t.pitch)),
|
|
1237
|
+
r.setAttribute("center", JSON.stringify(t.center)), r.setAttribute("zoom", String(t.zoom)), r.setAttribute("bearing", String(t.bearing)), r.setAttribute("pitch", String(t.pitch)), Zr(r, t);
|
|
1227
1238
|
}
|
|
1228
|
-
function
|
|
1239
|
+
function Zr(r, t) {
|
|
1229
1240
|
const e = r;
|
|
1230
1241
|
typeof e.setViewInternal == "function" ? e.setViewInternal({ longitude: t.center[0], latitude: t.center[1], zoom: t.zoom, pitch: t.pitch, bearing: t.bearing }) : typeof e.flyTo == "function" && e.flyTo(t.center, t.zoom, { duration: 0 });
|
|
1231
1242
|
}
|
|
@@ -1281,7 +1292,7 @@ class Ue extends R {
|
|
|
1281
1292
|
* than caching it correctly.
|
|
1282
1293
|
*/
|
|
1283
1294
|
get georef() {
|
|
1284
|
-
const { w: t, h: e } =
|
|
1295
|
+
const { w: t, h: e } = S(this);
|
|
1285
1296
|
if (t <= 0 || e <= 0) return null;
|
|
1286
1297
|
if (this.mode === "live")
|
|
1287
1298
|
return this.liveCorners ? ht({ corners: this.liveCorners, widthMm: t, heightMm: e }) : null;
|
|
@@ -1350,25 +1361,27 @@ class Ue extends R {
|
|
|
1350
1361
|
// Live
|
|
1351
1362
|
// -------------------------------------------------------------------------
|
|
1352
1363
|
renderLive() {
|
|
1353
|
-
const t =
|
|
1354
|
-
|
|
1364
|
+
const t = this.raster;
|
|
1365
|
+
t && (t.style.display = "none");
|
|
1366
|
+
const e = Q(this);
|
|
1367
|
+
if (!e) {
|
|
1355
1368
|
this.showPlaceholder("no-camera", 'Live frame needs its own camera — center="[lng, lat]" and zoom=.');
|
|
1356
1369
|
return;
|
|
1357
1370
|
}
|
|
1358
|
-
this.updateLiveCorners(
|
|
1359
|
-
const
|
|
1371
|
+
this.updateLiveCorners(e);
|
|
1372
|
+
const n = this.liveSource();
|
|
1360
1373
|
if (this.liveMap)
|
|
1361
|
-
if (this.mountedSource !==
|
|
1374
|
+
if (this.mountedSource !== n)
|
|
1362
1375
|
this.releaseLiveMap();
|
|
1363
1376
|
else {
|
|
1364
|
-
At(this.liveMap,
|
|
1377
|
+
At(this.liveMap, e), this.sizeLiveMap();
|
|
1365
1378
|
return;
|
|
1366
1379
|
}
|
|
1367
1380
|
if (this.mounting) {
|
|
1368
|
-
if (this.mountingSource ===
|
|
1381
|
+
if (this.mountingSource === n) return;
|
|
1369
1382
|
this.abandonMount();
|
|
1370
1383
|
}
|
|
1371
|
-
this.mountLive(
|
|
1384
|
+
this.mountLive(n);
|
|
1372
1385
|
}
|
|
1373
1386
|
/** Inline maps are identified by node identity; fetched maps by their src=. */
|
|
1374
1387
|
liveSource() {
|
|
@@ -1381,13 +1394,13 @@ class Ue extends R {
|
|
|
1381
1394
|
this.mounting && this.abandonMount(), this.captureImage = null, this.liveMap && (this.liveMapOwned ? this.releaseLiveMap() : this.liveMap.hidden = !0);
|
|
1382
1395
|
}
|
|
1383
1396
|
releaseLiveMap() {
|
|
1384
|
-
this.liveMapOwned ? this.liveMap?.remove() : this.liveMap && (this.liveMap.hidden = !0), this.liveMap = null, this.liveMapOwned = !1, this.mountedSource = null, this.liveCorners = null, this.captureImage = null;
|
|
1397
|
+
this.liveMap?.removeEventListener("om-view-changed", this.onLiveViewChanged), this.liveMapOwned ? this.liveMap?.remove() : this.liveMap && (this.liveMap.hidden = !0), this.liveMap = null, this.liveMapOwned = !1, this.mountedSource = null, this.liveCorners = null, this.captureImage = null;
|
|
1385
1398
|
}
|
|
1386
|
-
updateLiveCorners(t =
|
|
1399
|
+
updateLiveCorners(t = Q(this)) {
|
|
1387
1400
|
if (!t) return;
|
|
1388
|
-
const e =
|
|
1401
|
+
const e = G();
|
|
1389
1402
|
if (!e) return;
|
|
1390
|
-
const { w: n, h: i } =
|
|
1403
|
+
const { w: n, h: i } = S(this), s = Pt(e, t, n * z, i * z);
|
|
1391
1404
|
this.liveCorners = s, s ? this.lastError === "degenerate-view" && this.clearPlaceholder() : this.showPlaceholder(
|
|
1392
1405
|
"degenerate-view",
|
|
1393
1406
|
"This camera cannot be georeferenced — the frame's top edge reaches the horizon. Reduce pitch below ~60°."
|
|
@@ -1397,15 +1410,15 @@ class Ue extends R {
|
|
|
1397
1410
|
const e = ++this.mountToken;
|
|
1398
1411
|
this.mounting = !0, this.mountingSource = t;
|
|
1399
1412
|
try {
|
|
1400
|
-
const { core: n, map: i } = await
|
|
1413
|
+
const { core: n, map: i } = await Xr(this);
|
|
1401
1414
|
if (e !== this.mountToken || !this.isConnected || this.mode !== "live" || this.liveSource() !== t) return;
|
|
1402
|
-
const s =
|
|
1415
|
+
const s = Q(this);
|
|
1403
1416
|
if (!s) return;
|
|
1404
1417
|
At(i, s);
|
|
1405
1418
|
const o = i;
|
|
1406
|
-
o.style.position = "absolute", o.style.inset = "0", o.style.display = "block", this.liveMapOwned = i.parentElement !== this, this.liveMapOwned && this.appendChild(i), i.setAttribute("data-om-carto-frame", ""), this.liveMap = o, this.mountedSource = t, this.sizeLiveMap(), this.clearPlaceholder();
|
|
1407
|
-
const { w: a, h: l } =
|
|
1408
|
-
if (this.liveCorners =
|
|
1419
|
+
o.style.position = "absolute", o.style.inset = "0", o.style.display = "block", this.liveMapOwned = i.parentElement !== this, this.liveMapOwned && this.appendChild(i), i.setAttribute("data-om-carto-frame", ""), this.liveMap = o, o.addEventListener("om-view-changed", this.onLiveViewChanged), this.mountedSource = t, this.sizeLiveMap(), this.clearPlaceholder();
|
|
1420
|
+
const { w: a, h: l } = S(this);
|
|
1421
|
+
if (this.liveCorners = Pt(n, s, a * z, l * z), await o.ready, e !== this.mountToken || (At(i, s), await o.whenSettled?.({ timeout: 2e4 }), e !== this.mountToken)) return;
|
|
1409
1422
|
this.signalReady();
|
|
1410
1423
|
} catch (n) {
|
|
1411
1424
|
if (e !== this.mountToken) return;
|
|
@@ -1416,8 +1429,35 @@ class Ue extends R {
|
|
|
1416
1429
|
}
|
|
1417
1430
|
}
|
|
1418
1431
|
sizeLiveMap() {
|
|
1419
|
-
this.liveMap && (this.liveMap.style.width = "100%", this.liveMap.style.height = "100%", this.liveMap.hidden = this.printing);
|
|
1432
|
+
this.liveMap && (this.liveMap.style.width = "100%", this.liveMap.style.height = "100%", this.liveMap.hidden = this.printing, this.capMapPitch());
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* Stop the adopted map tilting past what this frame can georeference.
|
|
1436
|
+
*
|
|
1437
|
+
* A frame without a georeference has no scale bar, no north arrow, no
|
|
1438
|
+
* graticule and no export — so letting a host drive the camera past the
|
|
1439
|
+
* limit produces a frame that renders an error instead of a map. The ceiling
|
|
1440
|
+
* is the frame's own, recomputed whenever its box changes, because it
|
|
1441
|
+
* depends on the box's aspect and the current zoom.
|
|
1442
|
+
*/
|
|
1443
|
+
capMapPitch() {
|
|
1444
|
+
const t = G();
|
|
1445
|
+
if (!t || !this.liveMap) return;
|
|
1446
|
+
const e = this.liveMap.getViewStateInternal?.(), n = e ? { center: [e.longitude, e.latitude], zoom: e.zoom, bearing: e.bearing, pitch: e.pitch } : Q(this);
|
|
1447
|
+
if (!n) return;
|
|
1448
|
+
const { w: i, h: s } = S(this), o = Kr(t, n, i * z, s * z), a = o >= 60 ? null : String(o);
|
|
1449
|
+
a !== this.liveMap.getAttribute("max-pitch") && (a === null ? this.liveMap.removeAttribute("max-pitch") : this.liveMap.setAttribute("max-pitch", a));
|
|
1420
1450
|
}
|
|
1451
|
+
/**
|
|
1452
|
+
* The ceiling follows the camera, so a zoom changes it.
|
|
1453
|
+
*
|
|
1454
|
+
* Bound once so add/remove pair up. Cheap enough to run on every reported
|
|
1455
|
+
* view: a probe is four unprojections and the attribute is only written when
|
|
1456
|
+
* the whole-degree answer actually moves.
|
|
1457
|
+
*/
|
|
1458
|
+
onLiveViewChanged = () => {
|
|
1459
|
+
this.capMapPitch();
|
|
1460
|
+
};
|
|
1421
1461
|
// -------------------------------------------------------------------------
|
|
1422
1462
|
// Locator inset (overview-of)
|
|
1423
1463
|
// -------------------------------------------------------------------------
|
|
@@ -1438,7 +1478,7 @@ class Ue extends R {
|
|
|
1438
1478
|
e?.remove();
|
|
1439
1479
|
return;
|
|
1440
1480
|
}
|
|
1441
|
-
const { w: o, h: a } =
|
|
1481
|
+
const { w: o, h: a } = S(this), l = [], [c, u, m, d] = s.corners, h = [
|
|
1442
1482
|
[c, u],
|
|
1443
1483
|
[u, m],
|
|
1444
1484
|
[m, d],
|
|
@@ -1446,7 +1486,7 @@ class Ue extends R {
|
|
|
1446
1486
|
];
|
|
1447
1487
|
for (const [b, w] of h)
|
|
1448
1488
|
for (let y = 0; y < le; y++) {
|
|
1449
|
-
const
|
|
1489
|
+
const C = y / le, v = [b[0] + (w[0] - b[0]) * C, b[1] + (w[1] - b[1]) * C], F = i.project(v);
|
|
1450
1490
|
F && l.push(`${F.xMm.toFixed(3)},${F.yMm.toFixed(3)}`);
|
|
1451
1491
|
}
|
|
1452
1492
|
if (l.length < 3) {
|
|
@@ -1504,11 +1544,11 @@ class Ue extends R {
|
|
|
1504
1544
|
* follows from the same source as any authored camera.
|
|
1505
1545
|
*/
|
|
1506
1546
|
fitBounds(t) {
|
|
1507
|
-
const [e, n, i, s] = t, { w: o, h: a } =
|
|
1547
|
+
const [e, n, i, s] = t, { w: o, h: a } = S(this);
|
|
1508
1548
|
if (o <= 0 || a <= 0) return;
|
|
1509
|
-
const l =
|
|
1549
|
+
const l = G();
|
|
1510
1550
|
if (!l) return;
|
|
1511
|
-
const c = new l.WebMercatorViewport({ width: o *
|
|
1551
|
+
const c = new l.WebMercatorViewport({ width: o * z, height: a * z, longitude: 0, latitude: 0, zoom: 0 }).fitBounds([
|
|
1512
1552
|
[e, n],
|
|
1513
1553
|
[i, s]
|
|
1514
1554
|
]);
|
|
@@ -1537,7 +1577,7 @@ class Ue extends R {
|
|
|
1537
1577
|
this.printing = !1, this.querySelector(":scope > img[data-om-carto-print]")?.remove(), this.liveMap && (this.liveMap.hidden = !1);
|
|
1538
1578
|
}
|
|
1539
1579
|
paintCartograph(t, e) {
|
|
1540
|
-
const { w: n, h: i } =
|
|
1580
|
+
const { w: n, h: i } = S(this), s = n * e.pxPerMm, o = i * e.pxPerMm;
|
|
1541
1581
|
if (s <= 0 || o <= 0) return;
|
|
1542
1582
|
const a = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, l = L(a?.backgroundColor);
|
|
1543
1583
|
l && (t.fillStyle = l, t.fillRect(0, 0, s, o));
|
|
@@ -1555,14 +1595,14 @@ class Ue extends R {
|
|
|
1555
1595
|
}
|
|
1556
1596
|
}
|
|
1557
1597
|
x("om-frame", Ue);
|
|
1558
|
-
const
|
|
1559
|
-
class
|
|
1598
|
+
const it = "http://www.w3.org/2000/svg", Jr = ["single", "double", "line", "ticks"];
|
|
1599
|
+
class ze extends R {
|
|
1560
1600
|
static observedAttributes = [...P["om-scalebar"]];
|
|
1561
1601
|
/** The geometry currently drawn — reused by the canvas exporter. */
|
|
1562
1602
|
get drawing() {
|
|
1563
1603
|
const e = O(this)?.georef;
|
|
1564
1604
|
if (!e) return null;
|
|
1565
|
-
const { w: n, h: i } =
|
|
1605
|
+
const { w: n, h: i } = S(this), s = $e({
|
|
1566
1606
|
groundMetersPerMm: e.groundMetersPerMm(),
|
|
1567
1607
|
maxWidthMm: n,
|
|
1568
1608
|
segments: Number(this.getAttribute("segments")) || void 0,
|
|
@@ -1573,38 +1613,38 @@ class je extends R {
|
|
|
1573
1613
|
}
|
|
1574
1614
|
get barStyle() {
|
|
1575
1615
|
const t = this.getAttribute("kind");
|
|
1576
|
-
return
|
|
1616
|
+
return Jr.includes(t) ? t : "single";
|
|
1577
1617
|
}
|
|
1578
1618
|
get unitSystem() {
|
|
1579
|
-
return
|
|
1619
|
+
return Mr(this.getAttribute("units")) ?? "metric";
|
|
1580
1620
|
}
|
|
1581
1621
|
renderNow() {
|
|
1582
1622
|
if (this.applyPlacement(), this.style.display = "block", !O(this)) {
|
|
1583
1623
|
const n = this.getAttribute("for");
|
|
1584
|
-
|
|
1624
|
+
W(this, n ? `Scale bar references no frame with id "${n}".` : "Scale bar has no frame to measure (set for=).");
|
|
1585
1625
|
return;
|
|
1586
1626
|
}
|
|
1587
1627
|
const e = this.drawing;
|
|
1588
1628
|
if (!e) {
|
|
1589
|
-
|
|
1629
|
+
W(this, "Scale bar cannot derive a scale from this frame yet.");
|
|
1590
1630
|
return;
|
|
1591
1631
|
}
|
|
1592
1632
|
this.renderSvg(e);
|
|
1593
1633
|
}
|
|
1594
1634
|
renderSvg(t) {
|
|
1595
|
-
const { w: e, h: n } =
|
|
1635
|
+
const { w: e, h: n } = S(this), i = this.ownerDocument, s = i.createElementNS(it, "svg");
|
|
1596
1636
|
s.setAttribute("width", `${e}mm`), s.setAttribute("height", `${n}mm`), s.setAttribute("viewBox", `0 0 ${e} ${n}`), s.setAttribute("part", "scalebar"), s.style.display = "block", s.style.overflow = "visible";
|
|
1597
1637
|
const o = "var(--om-carto-scalebar-ink)";
|
|
1598
1638
|
for (const a of t.bars) {
|
|
1599
|
-
const l = i.createElementNS(
|
|
1639
|
+
const l = i.createElementNS(it, "rect");
|
|
1600
1640
|
l.setAttribute("x", String(a.x)), l.setAttribute("y", String(a.y)), l.setAttribute("width", String(a.w)), l.setAttribute("height", String(a.h)), l.setAttribute("fill", a.filled ? o : "none"), l.setAttribute("stroke", o), l.setAttribute("stroke-width", String(t.strokeMm)), s.appendChild(l);
|
|
1601
1641
|
}
|
|
1602
1642
|
for (const a of t.strokes) {
|
|
1603
|
-
const l = i.createElementNS(
|
|
1643
|
+
const l = i.createElementNS(it, "line");
|
|
1604
1644
|
l.setAttribute("x1", String(a.x1)), l.setAttribute("y1", String(a.y1)), l.setAttribute("x2", String(a.x2)), l.setAttribute("y2", String(a.y2)), l.setAttribute("stroke", o), l.setAttribute("stroke-width", String(t.strokeMm)), s.appendChild(l);
|
|
1605
1645
|
}
|
|
1606
1646
|
for (const a of t.labels) {
|
|
1607
|
-
const l = i.createElementNS(
|
|
1647
|
+
const l = i.createElementNS(it, "text");
|
|
1608
1648
|
l.setAttribute("x", String(a.x)), l.setAttribute("y", String(a.y)), l.setAttribute("font-size", String(t.fontMm)), l.setAttribute("fill", o), l.setAttribute("text-anchor", a.anchor), l.setAttribute("font-family", "var(--om-carto-font)"), l.textContent = a.text, s.appendChild(l);
|
|
1609
1649
|
}
|
|
1610
1650
|
this.replaceChildren(s);
|
|
@@ -1626,9 +1666,9 @@ class je extends R {
|
|
|
1626
1666
|
t.textAlign = l.anchor === "middle" ? "center" : l.anchor === "end" ? "right" : "left", t.fillText(l.text, o(l.x), o(l.y));
|
|
1627
1667
|
}
|
|
1628
1668
|
}
|
|
1629
|
-
x("om-scalebar",
|
|
1669
|
+
x("om-scalebar", ze);
|
|
1630
1670
|
const J = "http://www.w3.org/2000/svg";
|
|
1631
|
-
class
|
|
1671
|
+
class je extends R {
|
|
1632
1672
|
static observedAttributes = [...P["om-north"]];
|
|
1633
1673
|
/** Degrees clockwise from the page's "up", or null when unknowable. */
|
|
1634
1674
|
get bearing() {
|
|
@@ -1641,15 +1681,15 @@ class ze extends R {
|
|
|
1641
1681
|
renderNow() {
|
|
1642
1682
|
if (this.applyPlacement(), this.style.display = "block", !O(this)) {
|
|
1643
1683
|
const l = this.getAttribute("for");
|
|
1644
|
-
|
|
1684
|
+
W(this, l ? `North indicator references no frame with id "${l}".` : "North indicator has no frame (set for=).");
|
|
1645
1685
|
return;
|
|
1646
1686
|
}
|
|
1647
1687
|
const e = this.bearing;
|
|
1648
1688
|
if (e == null) {
|
|
1649
|
-
|
|
1689
|
+
W(this, "North indicator cannot derive a direction from this frame yet.");
|
|
1650
1690
|
return;
|
|
1651
1691
|
}
|
|
1652
|
-
const { w: n, h: i } =
|
|
1692
|
+
const { w: n, h: i } = S(this), s = this.ownerDocument, o = s.createElementNS(J, "svg");
|
|
1653
1693
|
o.setAttribute("width", `${n}mm`), o.setAttribute("height", `${i}mm`), o.setAttribute("viewBox", `0 0 ${n} ${i}`), o.style.display = "block";
|
|
1654
1694
|
const a = s.createElementNS(J, "g");
|
|
1655
1695
|
a.setAttribute("transform", `rotate(${e.toFixed(3)} ${n / 2} ${i / 2})`);
|
|
@@ -1670,17 +1710,17 @@ class ze extends R {
|
|
|
1670
1710
|
paintCartograph(t, e) {
|
|
1671
1711
|
const n = this.bearing;
|
|
1672
1712
|
if (n == null) return;
|
|
1673
|
-
const { w: i, h: s } =
|
|
1713
|
+
const { w: i, h: s } = S(this), o = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, a = L(o?.color) ?? "#000", l = (h) => h * e.pxPerMm, c = Math.min(3, s * 0.24), u = s - c * 1.2, m = i / 2, d = Math.min(i * 0.3, 4);
|
|
1674
1714
|
t.save(), t.translate(l(m), l(s / 2)), t.rotate(n * Math.PI / 180), t.translate(-l(m), -l(s / 2)), t.fillStyle = a, t.strokeStyle = a, this.indicatorKind === "rose" && (t.lineWidth = l(0.2), t.beginPath(), t.arc(l(m), l(u / 2), l(Math.min(i, u) / 2), 0, Math.PI * 2), t.stroke()), t.beginPath(), t.moveTo(l(m), 0), t.lineTo(l(m + d), l(u)), t.lineTo(l(m), l(u - d * 0.55)), t.lineTo(l(m - d), l(u)), t.closePath(), t.fill(), t.font = `${l(c)}px ${o?.fontFamily || "system-ui, sans-serif"}`, t.textAlign = "center", t.textBaseline = "alphabetic", t.fillText("N", l(m), l(s)), t.restore();
|
|
1675
1715
|
}
|
|
1676
1716
|
}
|
|
1677
|
-
x("om-north",
|
|
1678
|
-
const
|
|
1717
|
+
x("om-north", je);
|
|
1718
|
+
const ot = "http://www.w3.org/2000/svg", Qr = ["rect", "ellipse", "line", "arrow"];
|
|
1679
1719
|
class De extends R {
|
|
1680
1720
|
static observedAttributes = [...P["om-shape"]];
|
|
1681
1721
|
get kind() {
|
|
1682
1722
|
const t = this.getAttribute("kind");
|
|
1683
|
-
return
|
|
1723
|
+
return Qr.includes(t) ? t : "rect";
|
|
1684
1724
|
}
|
|
1685
1725
|
get fill() {
|
|
1686
1726
|
return this.getAttribute("fill") || "var(--om-carto-shape-fill)";
|
|
@@ -1706,11 +1746,11 @@ class De extends R {
|
|
|
1706
1746
|
}
|
|
1707
1747
|
renderNow() {
|
|
1708
1748
|
this.applyPlacement(), this.style.display = "block";
|
|
1709
|
-
const { w: t, h: e } =
|
|
1749
|
+
const { w: t, h: e } = S(this), n = this.ownerDocument, i = n.createElementNS(ot, "svg");
|
|
1710
1750
|
i.setAttribute("width", `${t}mm`), i.setAttribute("height", `${e}mm`), i.setAttribute("viewBox", `0 0 ${t} ${e}`), i.style.display = "block", i.style.overflow = "visible";
|
|
1711
1751
|
const s = this.strokeWidthMm / 2, o = this.kind;
|
|
1712
1752
|
let a;
|
|
1713
|
-
o === "ellipse" ? (a = n.createElementNS(
|
|
1753
|
+
o === "ellipse" ? (a = n.createElementNS(ot, "ellipse"), a.setAttribute("cx", String(t / 2)), a.setAttribute("cy", String(e / 2)), a.setAttribute("rx", String(Math.max(0, t / 2 - s))), a.setAttribute("ry", String(Math.max(0, e / 2 - s)))) : o === "line" || o === "arrow" ? (a = n.createElementNS(ot, "path"), a.setAttribute("d", o === "arrow" ? this.arrowPath(t, e) : `M 0 0 L ${t} ${e}`)) : (a = n.createElementNS(ot, "rect"), a.setAttribute("x", String(s)), a.setAttribute("y", String(s)), a.setAttribute("width", String(Math.max(0, t - this.strokeWidthMm))), a.setAttribute("height", String(Math.max(0, e - this.strokeWidthMm))), this.radiusMm > 0 && a.setAttribute("rx", String(this.radiusMm)));
|
|
1714
1754
|
const l = o === "rect" || o === "ellipse" || o === "arrow";
|
|
1715
1755
|
a.setAttribute("fill", l ? this.fill : "none"), l && a.setAttribute("fill-opacity", String(this.fillOpacity)), a.setAttribute("stroke", this.stroke), a.setAttribute("stroke-width", String(this.strokeWidthMm)), i.appendChild(a), this.replaceChildren(i);
|
|
1716
1756
|
}
|
|
@@ -1720,7 +1760,7 @@ class De extends R {
|
|
|
1720
1760
|
return `M 0 0 L ${s} ${o} M ${s} ${o} L ${a.x} ${a.y} L ${l.x} ${l.y} Z`;
|
|
1721
1761
|
}
|
|
1722
1762
|
paintCartograph(t, e) {
|
|
1723
|
-
const { w: n, h: i } =
|
|
1763
|
+
const { w: n, h: i } = S(this);
|
|
1724
1764
|
if (n <= 0 || i <= 0) return;
|
|
1725
1765
|
const s = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, o = (d) => d * e.pxPerMm, a = this.getAttribute("fill") || s?.getPropertyValue("--om-carto-shape-fill")?.trim() || "#cccccc", l = this.getAttribute("stroke") || s?.getPropertyValue("--om-carto-shape-stroke")?.trim() || "#333333", c = o(this.strokeWidthMm), u = c / 2, m = this.kind;
|
|
1726
1766
|
if (t.save(), t.globalAlpha = this.fillOpacity, t.fillStyle = a, t.strokeStyle = l, t.lineWidth = c, m === "ellipse")
|
|
@@ -1738,12 +1778,12 @@ class De extends R {
|
|
|
1738
1778
|
}
|
|
1739
1779
|
}
|
|
1740
1780
|
x("om-shape", De);
|
|
1741
|
-
const ue = "data-om-carto-owned",
|
|
1781
|
+
const ue = "data-om-carto-owned", tn = ["contain", "cover", "fill"];
|
|
1742
1782
|
class Ge extends R {
|
|
1743
1783
|
static observedAttributes = [...P["om-image"]];
|
|
1744
1784
|
get fit() {
|
|
1745
1785
|
const t = this.getAttribute("fit");
|
|
1746
|
-
return
|
|
1786
|
+
return tn.includes(t ?? "") ? t : "contain";
|
|
1747
1787
|
}
|
|
1748
1788
|
get image() {
|
|
1749
1789
|
return this.querySelector(":scope > img");
|
|
@@ -1757,7 +1797,7 @@ class Ge extends R {
|
|
|
1757
1797
|
paintCartograph(t, e) {
|
|
1758
1798
|
const n = this.image;
|
|
1759
1799
|
if (!n || !n.complete || n.naturalWidth === 0) return;
|
|
1760
|
-
const { w: i, h: s } =
|
|
1800
|
+
const { w: i, h: s } = S(this), o = i * e.pxPerMm, a = s * e.pxPerMm;
|
|
1761
1801
|
if (o <= 0 || a <= 0) return;
|
|
1762
1802
|
const l = this.fit;
|
|
1763
1803
|
if (l === "fill") {
|
|
@@ -1769,12 +1809,12 @@ class Ge extends R {
|
|
|
1769
1809
|
}
|
|
1770
1810
|
}
|
|
1771
1811
|
x("om-image", Ge);
|
|
1772
|
-
const
|
|
1773
|
-
function
|
|
1812
|
+
const en = /* @__PURE__ */ new Set(["PathLayer", "LineLayer", "ArcLayer", "TripsLayer", "GreatCircleLayer", "PathStyleLayer"]), rn = /* @__PURE__ */ new Set(["ScatterplotLayer", "IconLayer", "TextLayer", "PointCloudLayer", "HeatmapLayer", "ScreenGridLayer"]), nn = /* @__PURE__ */ new Set(["COGLayer", "ZarrLayer", "BitmapLayer", "TerrainLayer", "ImageOverlay"]);
|
|
1813
|
+
function on(r) {
|
|
1774
1814
|
const t = r.type ?? "";
|
|
1775
|
-
if (
|
|
1776
|
-
if (
|
|
1777
|
-
if (
|
|
1815
|
+
if (nn.has(t)) return "ramp";
|
|
1816
|
+
if (en.has(t)) return "line";
|
|
1817
|
+
if (rn.has(t)) return "point";
|
|
1778
1818
|
if (t === "GeoJsonLayer") {
|
|
1779
1819
|
const e = r.props ?? {}, n = e.getFillColor !== void 0, i = e.getLineColor !== void 0;
|
|
1780
1820
|
if (n && !i) return "polygon";
|
|
@@ -1782,24 +1822,24 @@ function nn(r) {
|
|
|
1782
1822
|
}
|
|
1783
1823
|
return "polygon";
|
|
1784
1824
|
}
|
|
1785
|
-
function
|
|
1825
|
+
function sn(r) {
|
|
1786
1826
|
const t = r.meta?.legend;
|
|
1787
1827
|
return r.meta?.color ?? (t?.kind === "ramp" ? t.colors[0] : t?.entries[0]?.color) ?? "#999";
|
|
1788
1828
|
}
|
|
1789
1829
|
const xt = 12;
|
|
1790
|
-
function
|
|
1830
|
+
function an(r, t = []) {
|
|
1791
1831
|
const e = [];
|
|
1792
1832
|
for (const n of r) {
|
|
1793
1833
|
if (n.props?.visible === !1) continue;
|
|
1794
1834
|
const i = t.filter((a) => a.layer === n.id), s = i.find((a) => a.match == null);
|
|
1795
1835
|
if (s?.hide) continue;
|
|
1796
|
-
const o =
|
|
1836
|
+
const o = ln(n.meta?.legend);
|
|
1797
1837
|
e.push({
|
|
1798
1838
|
layerId: n.id,
|
|
1799
1839
|
label: s?.label ?? n.meta?.label ?? n.id,
|
|
1800
|
-
color: s?.color ??
|
|
1801
|
-
shape: s?.shape ??
|
|
1802
|
-
legend:
|
|
1840
|
+
color: s?.color ?? sn(n),
|
|
1841
|
+
shape: s?.shape ?? on(n),
|
|
1842
|
+
legend: cn(o, i),
|
|
1803
1843
|
order: s?.order
|
|
1804
1844
|
});
|
|
1805
1845
|
}
|
|
@@ -1808,7 +1848,7 @@ function sn(r, t = []) {
|
|
|
1808
1848
|
return s - o || n.index - i.index;
|
|
1809
1849
|
}).map((n) => n.row);
|
|
1810
1850
|
}
|
|
1811
|
-
function
|
|
1851
|
+
function ln(r) {
|
|
1812
1852
|
if (!r || r.kind !== "categories" || r.entries.length <= xt) return r;
|
|
1813
1853
|
const t = r.entries.slice(0, xt), e = r.entries.length - xt;
|
|
1814
1854
|
return {
|
|
@@ -1816,7 +1856,7 @@ function an(r) {
|
|
|
1816
1856
|
entries: [...t, { color: r.defaultColor ?? "#999", label: `+${e} more` }]
|
|
1817
1857
|
};
|
|
1818
1858
|
}
|
|
1819
|
-
function
|
|
1859
|
+
function cn(r, t) {
|
|
1820
1860
|
const e = t.filter((i) => i.match != null);
|
|
1821
1861
|
if (!r || r.kind === "ramp" || e.length === 0) return r;
|
|
1822
1862
|
const n = [];
|
|
@@ -1826,7 +1866,7 @@ function ln(r, t) {
|
|
|
1826
1866
|
}
|
|
1827
1867
|
return { ...r, entries: n };
|
|
1828
1868
|
}
|
|
1829
|
-
function
|
|
1869
|
+
function un(r) {
|
|
1830
1870
|
const t = [];
|
|
1831
1871
|
for (const e of r.querySelectorAll(":scope > om-legend-row")) {
|
|
1832
1872
|
const n = e.getAttribute("layer");
|
|
@@ -1869,17 +1909,17 @@ class We extends R {
|
|
|
1869
1909
|
get rows() {
|
|
1870
1910
|
if (!this.derived) return qe(this);
|
|
1871
1911
|
const n = O(this)?.mapElement?.getLayers?.();
|
|
1872
|
-
return n ?
|
|
1912
|
+
return n ? an(n, un(this)) : [];
|
|
1873
1913
|
}
|
|
1874
1914
|
renderNow() {
|
|
1875
1915
|
if (this.applyPlacement(), this.style.display = "block", this.style.boxSizing = "border-box", this.style.overflow = "hidden", this.derived && !O(this)) {
|
|
1876
1916
|
const e = this.getAttribute("for");
|
|
1877
|
-
|
|
1917
|
+
W(this, e ? `Legend references no frame with id "${e}".` : "Legend has no frame to derive from (set for=).");
|
|
1878
1918
|
return;
|
|
1879
1919
|
}
|
|
1880
1920
|
const t = this.rows;
|
|
1881
1921
|
if (t.length === 0 && this.derived) {
|
|
1882
|
-
|
|
1922
|
+
W(this, "Legend is waiting for its frame's layers.");
|
|
1883
1923
|
return;
|
|
1884
1924
|
}
|
|
1885
1925
|
this.renderRows(t);
|
|
@@ -1919,47 +1959,47 @@ class We extends R {
|
|
|
1919
1959
|
const o = t.createElement("div");
|
|
1920
1960
|
o.style.cssText = `height:2.4mm;background:linear-gradient(to right, ${i.colors.join(", ")});border:0.15mm solid rgba(0,0,0,.25);`, n.appendChild(o);
|
|
1921
1961
|
const a = t.createElement("div");
|
|
1922
|
-
return a.style.cssText = "display:flex;justify-content:space-between;font-size:2.1mm;opacity:.75;", a.append(
|
|
1962
|
+
return a.style.cssText = "display:flex;justify-content:space-between;font-size:2.1mm;opacity:.75;", a.append(st(t, i.domain[0].toLocaleString("en-US")), st(t, i.domain[1].toLocaleString("en-US"))), n.appendChild(a), n;
|
|
1923
1963
|
}
|
|
1924
1964
|
for (const o of i.entries) {
|
|
1925
1965
|
const a = t.createElement("div");
|
|
1926
|
-
a.style.cssText = "display:flex;align-items:center;gap:1.2mm;margin:0.3mm 0;font-size:2.3mm;", a.appendChild(this.buildSwatch(t, o.color, "polygon")), a.appendChild(
|
|
1966
|
+
a.style.cssText = "display:flex;align-items:center;gap:1.2mm;margin:0.3mm 0;font-size:2.3mm;", a.appendChild(this.buildSwatch(t, o.color, "polygon")), a.appendChild(st(t, o.label)), n.appendChild(a);
|
|
1927
1967
|
}
|
|
1928
1968
|
if (i.kind === "categories" && i.defaultColor) {
|
|
1929
1969
|
const o = t.createElement("div");
|
|
1930
|
-
o.style.cssText = "display:flex;align-items:center;gap:1.2mm;margin:0.3mm 0;font-size:2.3mm;", o.appendChild(this.buildSwatch(t, i.defaultColor, "polygon")), o.appendChild(
|
|
1970
|
+
o.style.cssText = "display:flex;align-items:center;gap:1.2mm;margin:0.3mm 0;font-size:2.3mm;", o.appendChild(this.buildSwatch(t, i.defaultColor, "polygon")), o.appendChild(st(t, "other")), n.appendChild(o);
|
|
1931
1971
|
}
|
|
1932
1972
|
return n;
|
|
1933
1973
|
}
|
|
1934
1974
|
paintCartograph(t, e) {
|
|
1935
|
-
const { w: n, h: i } =
|
|
1975
|
+
const { w: n, h: i } = S(this), s = n * e.pxPerMm, o = i * e.pxPerMm;
|
|
1936
1976
|
if (s <= 0 || o <= 0) return;
|
|
1937
1977
|
const a = typeof getComputedStyle == "function" ? getComputedStyle(this) : null, l = L(a?.backgroundColor);
|
|
1938
1978
|
l && (t.fillStyle = l, t.fillRect(0, 0, s, o));
|
|
1939
|
-
const c = L(a?.borderTopColor), u =
|
|
1979
|
+
const c = L(a?.borderTopColor), u = $t(a?.borderTopWidth) * e.scale;
|
|
1940
1980
|
c && u > 0 && (t.strokeStyle = c, t.lineWidth = u, t.strokeRect(u / 2, u / 2, s - u, o - u));
|
|
1941
1981
|
const m = L(a?.color) ?? "#111", d = a?.fontFamily || "system-ui, sans-serif", h = (N) => N * e.pxPerMm;
|
|
1942
1982
|
let f = h(2);
|
|
1943
1983
|
const p = this.getAttribute("title");
|
|
1944
1984
|
p && (t.fillStyle = m, t.font = `600 ${h(2.6)}px ${d}`, t.textBaseline = "top", t.fillText(p, h(2), f), f += h(4));
|
|
1945
|
-
const g = this.rows, b = Number(this.getAttribute("columns")), w = Math.min(g.length || 1, Number.isFinite(b) && b > 1 ? Math.floor(b) : 1), y = Math.max(1, Math.ceil(g.length / w)),
|
|
1946
|
-
let _ = -1,
|
|
1985
|
+
const g = this.rows, b = Number(this.getAttribute("columns")), w = Math.min(g.length || 1, Number.isFinite(b) && b > 1 ? Math.floor(b) : 1), y = Math.max(1, Math.ceil(g.length / w)), C = 3, v = Math.max(1, (n - 4 - C * (w - 1)) / w), F = f;
|
|
1986
|
+
let _ = -1, k = 2;
|
|
1947
1987
|
t.font = `${h(2.6)}px ${d}`;
|
|
1948
1988
|
for (const [N, T] of g.entries()) {
|
|
1949
|
-
const
|
|
1950
|
-
if (
|
|
1989
|
+
const M = Math.min(w - 1, Math.floor(N / y));
|
|
1990
|
+
if (M !== _ && (_ = M, k = 2 + _ * (v + C), f = _ === 0 ? F : h(2)), f > o || (t.fillStyle = T.color, T.shape === "line" ? t.fillRect(h(k), f + h(1.2), h(3.2), h(0.9)) : T.shape === "point" ? (t.beginPath(), t.arc(h(k + 1.6), f + h(1.6), h(1.6), 0, Math.PI * 2), t.fill()) : t.fillRect(h(k), f, h(3.2), h(3.2)), t.fillStyle = m, t.textBaseline = "top", t.fillText(T.label, h(k + 4.7), f + h(0.3)), f += h(4.2), !T.legend)) continue;
|
|
1951
1991
|
const A = T.legend;
|
|
1952
|
-
if (t.save(), t.font = `${h(2.1)}px ${d}`, t.globalAlpha = 0.7, t.fillText(A.field, h(
|
|
1953
|
-
const
|
|
1954
|
-
A.colors.forEach((X, Xe) => U.addColorStop(A.colors.length === 1 ? 0 : Xe / (A.colors.length - 1), X)), t.fillStyle = U, t.fillRect(h(E), f, h(
|
|
1955
|
-
const
|
|
1956
|
-
t.textAlign = "right", t.fillText(
|
|
1992
|
+
if (t.save(), t.font = `${h(2.1)}px ${d}`, t.globalAlpha = 0.7, t.fillText(A.field, h(k + 2.7), f), t.globalAlpha = 1, f += h(2.8), A.kind === "ramp") {
|
|
1993
|
+
const $ = Math.min(24, Math.max(1, v - 2.7)), E = k + 2.7, U = t.createLinearGradient(h(E), 0, h(E + $), 0);
|
|
1994
|
+
A.colors.forEach((X, Xe) => U.addColorStop(A.colors.length === 1 ? 0 : Xe / (A.colors.length - 1), X)), t.fillStyle = U, t.fillRect(h(E), f, h($), h(2.4)), f += h(3.4), t.fillStyle = m, t.font = `${h(2.1)}px ${d}`, t.fillText(A.domain[0].toLocaleString("en-US"), h(E), f);
|
|
1995
|
+
const tt = A.domain[1].toLocaleString("en-US");
|
|
1996
|
+
t.textAlign = "right", t.fillText(tt, h(E + $), f), t.textAlign = "left", f += h(3.2);
|
|
1957
1997
|
} else {
|
|
1958
|
-
const
|
|
1959
|
-
A.kind === "categories" && A.defaultColor &&
|
|
1960
|
-
for (const E of
|
|
1998
|
+
const $ = [...A.entries];
|
|
1999
|
+
A.kind === "categories" && A.defaultColor && $.push({ color: A.defaultColor, label: "other" }), t.font = `${h(2.3)}px ${d}`;
|
|
2000
|
+
for (const E of $) {
|
|
1961
2001
|
if (f > o) break;
|
|
1962
|
-
t.fillStyle = E.color, t.fillRect(h(
|
|
2002
|
+
t.fillStyle = E.color, t.fillRect(h(k + 2.7), f, h(2.6), h(2.6)), t.fillStyle = m, t.fillText(E.label, h(k + 6.3), f + h(0.2)), f += h(3.2);
|
|
1963
2003
|
}
|
|
1964
2004
|
f += h(1);
|
|
1965
2005
|
}
|
|
@@ -1967,7 +2007,7 @@ class We extends R {
|
|
|
1967
2007
|
}
|
|
1968
2008
|
}
|
|
1969
2009
|
}
|
|
1970
|
-
const
|
|
2010
|
+
const st = (r, t) => {
|
|
1971
2011
|
const e = r.createElement("span");
|
|
1972
2012
|
return e.textContent = t, e;
|
|
1973
2013
|
};
|
|
@@ -1977,22 +2017,22 @@ const me = 48, Be = {
|
|
|
1977
2017
|
fromLngLat: (r) => [r[0], r[1]]
|
|
1978
2018
|
};
|
|
1979
2019
|
function de(r, t = 5) {
|
|
1980
|
-
return !Number.isFinite(r) || r <= 0 ? 0 :
|
|
2020
|
+
return !Number.isFinite(r) || r <= 0 ? 0 : ke(r / Math.max(1, t));
|
|
1981
2021
|
}
|
|
1982
|
-
function
|
|
2022
|
+
function hn({ georef: r, plane: t = Be, interval: e, intervalX: n, intervalY: i, labels: s = "outside", format: o }) {
|
|
1983
2023
|
if (r.degenerate) return null;
|
|
1984
2024
|
const a = r.corners.map((y) => t.fromLngLat(y)), l = a.map((y) => y[0]), c = a.map((y) => y[1]);
|
|
1985
2025
|
if (l.some((y) => !Number.isFinite(y)) || c.some((y) => !Number.isFinite(y))) return null;
|
|
1986
2026
|
const u = Math.min(...l), m = Math.max(...l), d = Math.min(...c), h = Math.max(...c), f = fe(n ?? e, de(m - u)), p = fe(i ?? e, de(h - d));
|
|
1987
2027
|
if (f <= 0 || p <= 0 || (m - u) / f > 500 || (h - d) / p > 500) return null;
|
|
1988
|
-
const g = [], b = [], w = o ??
|
|
2028
|
+
const g = [], b = [], w = o ?? dn;
|
|
1989
2029
|
for (let y = Math.ceil(u / f) * f; y <= m + 1e-9; y += f) {
|
|
1990
|
-
const
|
|
1991
|
-
|
|
2030
|
+
const C = pe(r, t, y, d, h, "x");
|
|
2031
|
+
C && (g.push(C), s !== "none" && be(b, C, r, w(y, "x"), "x", s));
|
|
1992
2032
|
}
|
|
1993
2033
|
for (let y = Math.ceil(d / p) * p; y <= h + 1e-9; y += p) {
|
|
1994
|
-
const
|
|
1995
|
-
|
|
2034
|
+
const C = pe(r, t, y, u, m, "y");
|
|
2035
|
+
C && (g.push(C), s !== "none" && be(b, C, r, w(y, "y"), "y", s));
|
|
1996
2036
|
}
|
|
1997
2037
|
return { lines: g, labels: b, intervalX: f, intervalY: p };
|
|
1998
2038
|
}
|
|
@@ -2005,10 +2045,10 @@ function pe(r, t, e, n, i, s) {
|
|
|
2005
2045
|
const m = r.project(u);
|
|
2006
2046
|
m && o.push(m);
|
|
2007
2047
|
}
|
|
2008
|
-
const a =
|
|
2048
|
+
const a = mn(o, r.widthMm, r.heightMm);
|
|
2009
2049
|
return a.length >= 2 ? { points: a, value: e, axis: s } : null;
|
|
2010
2050
|
}
|
|
2011
|
-
function
|
|
2051
|
+
function mn(r, t, e) {
|
|
2012
2052
|
const n = (a) => a.xMm >= -0.01 && a.xMm <= t + 0.01 && a.yMm >= -0.01 && a.yMm <= e + 0.01, i = r.findIndex(n);
|
|
2013
2053
|
if (i === -1) return [];
|
|
2014
2054
|
let s = r.length - 1;
|
|
@@ -2027,16 +2067,16 @@ function be(r, t, e, n, i, s) {
|
|
|
2027
2067
|
r.push({ text: n, xMm: s === "outside" ? -1.2 : 1.2, yMm: o.yMm, edge: "left", axis: i });
|
|
2028
2068
|
}
|
|
2029
2069
|
}
|
|
2030
|
-
function
|
|
2070
|
+
function dn(r, t) {
|
|
2031
2071
|
if (Math.abs(r) >= 1e3) return Math.round(r).toLocaleString("en-US");
|
|
2032
2072
|
const e = Math.abs(r) < 1 ? 3 : Math.abs(r) < 10 ? 2 : 1;
|
|
2033
2073
|
return `${Number(r.toFixed(e))}°`;
|
|
2034
2074
|
}
|
|
2035
|
-
function
|
|
2075
|
+
function fn(r, t) {
|
|
2036
2076
|
const e = t === "x" ? r < 0 ? "W" : "E" : r < 0 ? "S" : "N", n = Math.abs(r), i = Math.floor(n), s = (n - i) * 60, o = Math.floor(s), a = Math.round((s - o) * 60), l = a === 60 ? o + 1 : o, c = l === 60 ? i + 1 : i, u = l === 60 ? 0 : l, m = a === 60 ? 0 : a;
|
|
2037
2077
|
return `${c}°${String(u).padStart(2, "0")}′${String(m).padStart(2, "0")}″${e}`;
|
|
2038
2078
|
}
|
|
2039
|
-
const
|
|
2079
|
+
const at = "http://www.w3.org/2000/svg", pn = ["solid", "cross", "markers"], D = 1.4;
|
|
2040
2080
|
class Ve extends R {
|
|
2041
2081
|
static observedAttributes = [...P["om-graticule"]];
|
|
2042
2082
|
resolvedPlane = null;
|
|
@@ -2044,7 +2084,7 @@ class Ve extends R {
|
|
|
2044
2084
|
resolveToken = 0;
|
|
2045
2085
|
get kind() {
|
|
2046
2086
|
const t = this.getAttribute("kind");
|
|
2047
|
-
return
|
|
2087
|
+
return pn.includes(t) ? t : "solid";
|
|
2048
2088
|
}
|
|
2049
2089
|
get labelPlacement() {
|
|
2050
2090
|
const t = this.getAttribute("labels");
|
|
@@ -2060,14 +2100,14 @@ class Ve extends R {
|
|
|
2060
2100
|
const s = Number(this.getAttribute(i));
|
|
2061
2101
|
return Number.isFinite(s) && s > 0 ? s : null;
|
|
2062
2102
|
};
|
|
2063
|
-
return
|
|
2103
|
+
return hn({
|
|
2064
2104
|
georef: t,
|
|
2065
2105
|
plane: e,
|
|
2066
2106
|
interval: n("interval"),
|
|
2067
2107
|
intervalX: n("interval-x"),
|
|
2068
2108
|
intervalY: n("interval-y"),
|
|
2069
2109
|
labels: this.labelPlacement,
|
|
2070
|
-
format: this.getAttribute("format") === "dms" ?
|
|
2110
|
+
format: this.getAttribute("format") === "dms" ? fn : void 0
|
|
2071
2111
|
});
|
|
2072
2112
|
}
|
|
2073
2113
|
/**
|
|
@@ -2094,7 +2134,7 @@ class Ve extends R {
|
|
|
2094
2134
|
renderNow() {
|
|
2095
2135
|
if (this.applyPlacement(), this.style.display = "block", this.style.pointerEvents = "none", !O(this)) {
|
|
2096
2136
|
const n = this.getAttribute("for");
|
|
2097
|
-
|
|
2137
|
+
W(this, n ? `Graticule references no frame with id "${n}".` : "Graticule has no frame to cover (set for=).");
|
|
2098
2138
|
return;
|
|
2099
2139
|
}
|
|
2100
2140
|
const e = this.graticule;
|
|
@@ -2105,20 +2145,20 @@ class Ve extends R {
|
|
|
2105
2145
|
this.renderSvg(e);
|
|
2106
2146
|
}
|
|
2107
2147
|
renderSvg(t) {
|
|
2108
|
-
const { w: e, h: n } =
|
|
2148
|
+
const { w: e, h: n } = S(this), i = this.ownerDocument, s = i.createElementNS(at, "svg");
|
|
2109
2149
|
s.setAttribute("width", `${e}mm`), s.setAttribute("height", `${n}mm`), s.setAttribute("viewBox", `0 0 ${e} ${n}`), s.style.cssText = "display:block;overflow:visible;";
|
|
2110
2150
|
const o = "var(--om-carto-graticule-ink)", a = this.kind;
|
|
2111
2151
|
for (const l of t.lines)
|
|
2112
2152
|
if (a === "solid") {
|
|
2113
|
-
const c = i.createElementNS(
|
|
2153
|
+
const c = i.createElementNS(at, "polyline");
|
|
2114
2154
|
c.setAttribute("points", l.points.map((u) => `${u.xMm.toFixed(3)},${u.yMm.toFixed(3)}`).join(" ")), c.setAttribute("fill", "none"), c.setAttribute("stroke", o), c.setAttribute("stroke-width", "0.15"), s.appendChild(c);
|
|
2115
2155
|
} else
|
|
2116
2156
|
for (const c of this.tickPoints(l, a, t)) {
|
|
2117
|
-
const u = i.createElementNS(
|
|
2118
|
-
u.setAttribute("d", `M ${c.xMm -
|
|
2157
|
+
const u = i.createElementNS(at, "path");
|
|
2158
|
+
u.setAttribute("d", `M ${c.xMm - D} ${c.yMm} H ${c.xMm + D} M ${c.xMm} ${c.yMm - D} V ${c.yMm + D}`), u.setAttribute("stroke", o), u.setAttribute("stroke-width", "0.15"), s.appendChild(u);
|
|
2119
2159
|
}
|
|
2120
2160
|
for (const l of t.labels) {
|
|
2121
|
-
const c = i.createElementNS(
|
|
2161
|
+
const c = i.createElementNS(at, "text");
|
|
2122
2162
|
c.setAttribute("x", String(l.xMm)), c.setAttribute("y", String(l.yMm)), c.setAttribute("font-size", "2.2"), c.setAttribute("fill", o), c.setAttribute("font-family", "var(--om-carto-font)"), c.setAttribute("text-anchor", l.edge === "left" ? "end" : "middle"), c.textContent = l.text, s.appendChild(c);
|
|
2123
2163
|
}
|
|
2124
2164
|
this.replaceChildren(s);
|
|
@@ -2128,7 +2168,7 @@ class Ve extends R {
|
|
|
2128
2168
|
if (e === "markers") return [t.points[0], t.points[t.points.length - 1]];
|
|
2129
2169
|
const i = n.lines.filter((o) => o.axis !== t.axis), s = [];
|
|
2130
2170
|
for (const o of i) {
|
|
2131
|
-
const a =
|
|
2171
|
+
const a = gn(t.points, o.points);
|
|
2132
2172
|
a && s.push(a);
|
|
2133
2173
|
}
|
|
2134
2174
|
return s;
|
|
@@ -2143,14 +2183,14 @@ class Ve extends R {
|
|
|
2143
2183
|
t.beginPath(), l.points.forEach((c, u) => u === 0 ? t.moveTo(o(c.xMm), o(c.yMm)) : t.lineTo(o(c.xMm), o(c.yMm))), t.stroke();
|
|
2144
2184
|
else
|
|
2145
2185
|
for (const c of this.tickPoints(l, a, n))
|
|
2146
|
-
t.beginPath(), t.moveTo(o(c.xMm -
|
|
2186
|
+
t.beginPath(), t.moveTo(o(c.xMm - D), o(c.yMm)), t.lineTo(o(c.xMm + D), o(c.yMm)), t.moveTo(o(c.xMm), o(c.yMm - D)), t.lineTo(o(c.xMm), o(c.yMm + D)), t.stroke();
|
|
2147
2187
|
t.font = `${o(2.2)}px ${i?.fontFamily || "system-ui, sans-serif"}`, t.textBaseline = "alphabetic";
|
|
2148
2188
|
for (const l of n.labels)
|
|
2149
2189
|
t.textAlign = l.edge === "left" ? "right" : "center", t.fillText(l.text, o(l.xMm), o(l.yMm));
|
|
2150
2190
|
t.restore();
|
|
2151
2191
|
}
|
|
2152
2192
|
}
|
|
2153
|
-
function
|
|
2193
|
+
function gn(r, t) {
|
|
2154
2194
|
let e = null, n = Number.POSITIVE_INFINITY;
|
|
2155
2195
|
for (const i of r)
|
|
2156
2196
|
for (const s of t) {
|
|
@@ -2160,27 +2200,27 @@ function pn(r, t) {
|
|
|
2160
2200
|
return n <= 1 ? e : null;
|
|
2161
2201
|
}
|
|
2162
2202
|
x("om-graticule", Ve);
|
|
2163
|
-
function
|
|
2203
|
+
function bn(r, t) {
|
|
2164
2204
|
if (r == null || typeof r != "object") return;
|
|
2165
2205
|
const e = r.properties;
|
|
2166
2206
|
return e && t in e ? e[t] : r[t];
|
|
2167
2207
|
}
|
|
2168
|
-
function
|
|
2208
|
+
function Tt(r, t) {
|
|
2169
2209
|
if (Array.isArray(r)) {
|
|
2170
2210
|
if (typeof r[0] == "number") {
|
|
2171
2211
|
t.push([r[0], r[1]]);
|
|
2172
2212
|
return;
|
|
2173
2213
|
}
|
|
2174
|
-
for (const e of r)
|
|
2214
|
+
for (const e of r) Tt(e, t);
|
|
2175
2215
|
}
|
|
2176
2216
|
}
|
|
2177
|
-
function
|
|
2217
|
+
function yn(r) {
|
|
2178
2218
|
return r ? r.tileData != null ? "tiled" : r.asset != null ? "asset" : null : "empty";
|
|
2179
2219
|
}
|
|
2180
2220
|
function I(r, t) {
|
|
2181
|
-
return
|
|
2221
|
+
return bn(r, t);
|
|
2182
2222
|
}
|
|
2183
|
-
function
|
|
2223
|
+
function Lt(r) {
|
|
2184
2224
|
const t = {}, e = (i) => {
|
|
2185
2225
|
for (const [s, o] of Object.entries(i))
|
|
2186
2226
|
o == null || typeof o == "object" || (t[s] = String(o));
|
|
@@ -2189,11 +2229,11 @@ function Tt(r) {
|
|
|
2189
2229
|
const n = r.properties;
|
|
2190
2230
|
return n && typeof n == "object" && e(n), t;
|
|
2191
2231
|
}
|
|
2192
|
-
function
|
|
2232
|
+
function wn(r) {
|
|
2193
2233
|
let t = 1 / 0, e = 1 / 0, n = -1 / 0, i = -1 / 0;
|
|
2194
2234
|
const s = [], o = r.geometry;
|
|
2195
|
-
if (o?.coordinates != null)
|
|
2196
|
-
else if (Array.isArray(r.coordinates))
|
|
2235
|
+
if (o?.coordinates != null) Tt(o.coordinates, s);
|
|
2236
|
+
else if (Array.isArray(r.coordinates)) Tt(r.coordinates, s);
|
|
2197
2237
|
else {
|
|
2198
2238
|
const a = Number(I(r, "lng") ?? I(r, "longitude") ?? I(r, "lon") ?? I(r, "x")), l = Number(I(r, "lat") ?? I(r, "latitude") ?? I(r, "y"));
|
|
2199
2239
|
Number.isFinite(a) && Number.isFinite(l) && s.push([a, l]);
|
|
@@ -2202,47 +2242,47 @@ function yn(r) {
|
|
|
2202
2242
|
!Number.isFinite(a) || !Number.isFinite(l) || (t = Math.min(t, a), n = Math.max(n, a), e = Math.min(e, l), i = Math.max(i, l));
|
|
2203
2243
|
return !Number.isFinite(t) || !Number.isFinite(e) ? null : [t, e, n, i];
|
|
2204
2244
|
}
|
|
2205
|
-
function
|
|
2245
|
+
function vn(r, t) {
|
|
2206
2246
|
const [e, n, i, s] = r, o = Math.max(i - e, 1e-4), a = Math.max(s - n, 1e-4), l = o * t, c = a * t;
|
|
2207
2247
|
return [e - l, n - c, i + l, s + c];
|
|
2208
2248
|
}
|
|
2209
|
-
const
|
|
2249
|
+
const Hn = ([r, t, e, n]) => Math.max(0, e - r) * Math.max(0, n - t);
|
|
2210
2250
|
function Mn({ features: r, filter: t, sort: e }) {
|
|
2211
|
-
let n = t ? r.filter((s) =>
|
|
2212
|
-
const i =
|
|
2251
|
+
let n = t ? r.filter((s) => An(t, s)) : [...r];
|
|
2252
|
+
const i = Sn(e);
|
|
2213
2253
|
return i.length > 0 && (n = [...n].sort((s, o) => {
|
|
2214
2254
|
for (const { field: a, descending: l } of i) {
|
|
2215
2255
|
const c = I(s, a), u = I(o, a);
|
|
2216
2256
|
if (c == null && u == null) continue;
|
|
2217
2257
|
if (c == null) return 1;
|
|
2218
2258
|
if (u == null) return -1;
|
|
2219
|
-
const m =
|
|
2259
|
+
const m = Cn(c, u);
|
|
2220
2260
|
if (m !== 0) return l ? -m : m;
|
|
2221
2261
|
}
|
|
2222
2262
|
return 0;
|
|
2223
2263
|
})), n;
|
|
2224
2264
|
}
|
|
2225
|
-
function
|
|
2265
|
+
function An(r, t) {
|
|
2226
2266
|
try {
|
|
2227
2267
|
return !!r(t);
|
|
2228
2268
|
} catch {
|
|
2229
2269
|
return !1;
|
|
2230
2270
|
}
|
|
2231
2271
|
}
|
|
2232
|
-
function
|
|
2272
|
+
function Sn(r) {
|
|
2233
2273
|
return r ? r.split(",").map((t) => t.trim()).filter(Boolean).map((t) => t.startsWith("-") ? { field: t.slice(1), descending: !0 } : { field: t, descending: !1 }) : [];
|
|
2234
2274
|
}
|
|
2235
|
-
function
|
|
2275
|
+
function Cn(r, t) {
|
|
2236
2276
|
return typeof r == "number" && typeof t == "number" ? r - t : String(r).localeCompare(String(t), void 0, { numeric: !0, sensitivity: "base" });
|
|
2237
2277
|
}
|
|
2238
|
-
function
|
|
2278
|
+
function xn(r) {
|
|
2239
2279
|
const t = r.replace(/[\x00-\x1f<>:"/\\|?*]+/g, "-").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^[-.]+|[-.]+$/g, "").slice(0, 100);
|
|
2240
2280
|
return t === "" ? "page" : t;
|
|
2241
2281
|
}
|
|
2242
|
-
function
|
|
2282
|
+
function kn(r, t, e) {
|
|
2243
2283
|
const n = /* @__PURE__ */ new Map();
|
|
2244
2284
|
return t.map((i, s) => {
|
|
2245
|
-
const o =
|
|
2285
|
+
const o = Lt(i), a = (r ?? "page-{{atlas.index}}").replace(/\{\{\s*atlas\.([\w]+)\s*\}\}/g, (u, m) => m === "index" ? String(s + 1) : m === "count" ? String(t.length) : o[m] ?? u), l = xn(a), c = n.get(l) ?? 0;
|
|
2246
2286
|
return n.set(l, c + 1), `${c === 0 ? l : `${l}-${c + 1}`}.${e}`;
|
|
2247
2287
|
});
|
|
2248
2288
|
}
|
|
@@ -2275,13 +2315,13 @@ class He extends R {
|
|
|
2275
2315
|
}
|
|
2276
2316
|
/** Export filenames, one per page, already de-duplicated. */
|
|
2277
2317
|
filenames(t = "png") {
|
|
2278
|
-
return
|
|
2318
|
+
return kn(this.getAttribute("filename"), this.ensurePages(), t);
|
|
2279
2319
|
}
|
|
2280
2320
|
/** Human page labels, for an editor's stepper and PDF bookmarks. */
|
|
2281
2321
|
pageName(t) {
|
|
2282
2322
|
const e = this.ensurePages()[t];
|
|
2283
2323
|
if (!e) return `Page ${t + 1}`;
|
|
2284
|
-
const n =
|
|
2324
|
+
const n = Lt(e), i = this.getAttribute("page-name");
|
|
2285
2325
|
return i ? i.replace(
|
|
2286
2326
|
/\{\{\s*atlas\.([\w]+)\s*\}\}/g,
|
|
2287
2327
|
(s, o) => o === "index" ? String(t + 1) : o === "count" ? String(this.count) : n[o] ?? s
|
|
@@ -2299,7 +2339,7 @@ class He extends R {
|
|
|
2299
2339
|
}
|
|
2300
2340
|
ensurePages() {
|
|
2301
2341
|
if (this.pages) return this.pages;
|
|
2302
|
-
const e = this.frame?.mapElement?.getLayers?.(), n = this.getAttribute("layer"), i = e?.find((a) => a.id === n), s = e ?
|
|
2342
|
+
const e = this.frame?.mapElement?.getLayers?.(), n = this.getAttribute("layer"), i = e?.find((a) => a.id === n), s = e ? yn(i) : null;
|
|
2303
2343
|
if (!e || s)
|
|
2304
2344
|
return this.rejection = e ? s : null, this.pages = [];
|
|
2305
2345
|
const o = this.materialize(i);
|
|
@@ -2311,7 +2351,7 @@ class He extends R {
|
|
|
2311
2351
|
* sheets for features the map itself is hiding.
|
|
2312
2352
|
*/
|
|
2313
2353
|
materialize(t) {
|
|
2314
|
-
const e =
|
|
2354
|
+
const e = G(), n = t.data;
|
|
2315
2355
|
if (!n) return [];
|
|
2316
2356
|
const i = e?.asRows ? e.asRows(n) : Array.isArray(n) ? n : [], s = [t.filter, t.categoryFilter].filter(Boolean);
|
|
2317
2357
|
return s.length === 0 ? i : i.filter(
|
|
@@ -2330,7 +2370,7 @@ class He extends R {
|
|
|
2330
2370
|
compileFilter() {
|
|
2331
2371
|
const t = this.getAttribute("filter");
|
|
2332
2372
|
if (!t) return;
|
|
2333
|
-
const e =
|
|
2373
|
+
const e = G();
|
|
2334
2374
|
if (e?.compileExpression)
|
|
2335
2375
|
try {
|
|
2336
2376
|
const n = e.compileExpression(t, { shape: "geojson", paramName: "d" });
|
|
@@ -2354,12 +2394,12 @@ class He extends R {
|
|
|
2354
2394
|
const e = this.closest("om-cartograph");
|
|
2355
2395
|
for (const n of e?.querySelectorAll("om-frame") ?? []) {
|
|
2356
2396
|
if (n.getAttribute("atlas-fit") !== "feature") continue;
|
|
2357
|
-
const i =
|
|
2397
|
+
const i = wn(t);
|
|
2358
2398
|
if (!i) continue;
|
|
2359
|
-
const s = Number(n.getAttribute("atlas-margin")), o =
|
|
2399
|
+
const s = Number(n.getAttribute("atlas-margin")), o = vn(i, Number.isFinite(s) && s > 0 ? s : 0.15);
|
|
2360
2400
|
n.fitBounds?.(o);
|
|
2361
2401
|
}
|
|
2362
|
-
e?.setAtlasFields({ ...
|
|
2402
|
+
e?.setAtlasFields({ ...Lt(t), index: String(this.currentIndex + 1), count: String(this.count) }), e?.refreshFurniture(), this.dispatchEvent(
|
|
2363
2403
|
new CustomEvent("om-atlas-page", {
|
|
2364
2404
|
bubbles: !0,
|
|
2365
2405
|
detail: { index: this.currentIndex, count: this.count, name: this.pageName(this.currentIndex), feature: t }
|
|
@@ -2371,21 +2411,21 @@ class He extends R {
|
|
|
2371
2411
|
}
|
|
2372
2412
|
}
|
|
2373
2413
|
x("om-atlas", He);
|
|
2374
|
-
const $n = /* @__PURE__ */ new Set(["class", "style", "id", "hidden", "title", "lang", "dir", "slot", "part", "role", "tabindex"]),
|
|
2414
|
+
const $n = /* @__PURE__ */ new Set(["class", "style", "id", "hidden", "title", "lang", "dir", "slot", "part", "role", "tabindex"]), En = /* @__PURE__ */ new Set(["style", "script", "img", "template", "om-map"]), Nn = ["data-om-carto-credit", "data-om-carto-marks", "data-om-carto-flattened"], Pn = /* @__PURE__ */ new Set(["om-text", "om-legend", "om-scalebar", "om-north", "om-shape", "om-image"]), Tn = /* @__PURE__ */ new Set(["om-frame", "om-legend", "om-scalebar", "om-north", "om-graticule", "om-text", "om-shape", "om-image"]), Ln = 0.02, Fn = (r) => Math.max(0, Number(r.getAttribute("bleed")) || 0);
|
|
2375
2415
|
function Ye(r) {
|
|
2376
2416
|
const t = r.tagName.toLowerCase();
|
|
2377
2417
|
return r.id ? `${t}#${r.id}` : t;
|
|
2378
2418
|
}
|
|
2379
|
-
function
|
|
2419
|
+
function H(r, t) {
|
|
2380
2420
|
const e = r.getAttribute(t);
|
|
2381
2421
|
if (e == null || e.trim() === "") return null;
|
|
2382
2422
|
const n = Number(e);
|
|
2383
2423
|
return Number.isFinite(n) ? n : null;
|
|
2384
2424
|
}
|
|
2385
|
-
function
|
|
2425
|
+
function In(r, t) {
|
|
2386
2426
|
return r.x < t.x + t.w && t.x < r.x + r.w && r.y < t.y + t.h && t.y < r.y + r.h;
|
|
2387
2427
|
}
|
|
2388
|
-
function
|
|
2428
|
+
function Rn(r, t) {
|
|
2389
2429
|
const e = r.getAttribute("style");
|
|
2390
2430
|
if (!e) return null;
|
|
2391
2431
|
const n = new RegExp(`(?:^|;)\\s*${t}\\s*:\\s*(-?[\\d.]+)mm`, "i").exec(e);
|
|
@@ -2397,45 +2437,45 @@ function Ke(r) {
|
|
|
2397
2437
|
}, n = [...r.querySelectorAll("om-cartograph")];
|
|
2398
2438
|
if (n.length === 0 && r.tagName?.toLowerCase() === "om-cartograph" && n.push(r), n.length === 0)
|
|
2399
2439
|
return { valid: !0, errors: [], warnings: [] };
|
|
2400
|
-
for (const o of n)
|
|
2440
|
+
for (const o of n) _n(o, e);
|
|
2401
2441
|
const i = t.filter((o) => o.severity === "error"), s = t.filter((o) => o.severity === "warning");
|
|
2402
2442
|
return { valid: i.length === 0, errors: i, warnings: s };
|
|
2403
2443
|
}
|
|
2404
|
-
function
|
|
2405
|
-
const e = r.getAttribute("size"), n =
|
|
2406
|
-
e && !
|
|
2444
|
+
function _n(r, t) {
|
|
2445
|
+
const e = r.getAttribute("size"), n = H(r, "width") != null && H(r, "height") != null;
|
|
2446
|
+
e && !Vt.includes(e) && !n && t(
|
|
2407
2447
|
"error",
|
|
2408
2448
|
r,
|
|
2409
2449
|
`Unknown page size "${e}" and no width/height to fall back on.`,
|
|
2410
|
-
`Use one of ${
|
|
2450
|
+
`Use one of ${Vt.join(", ")}, or give width= and height= in millimetres.`,
|
|
2411
2451
|
"size"
|
|
2412
2452
|
);
|
|
2413
2453
|
const i = r.getAttribute("cvd");
|
|
2414
|
-
i && i.trim().toLowerCase() !== "none" && !
|
|
2415
|
-
const s =
|
|
2454
|
+
i && i.trim().toLowerCase() !== "none" && !Ft(i) && t("warning", r, `Unknown cvd="${i}" — no simulation applied.`, `Use one of ${rr.join(", ")}.`, "cvd"), r.hasAttribute("crop-marks") && Fn(r) <= 0 && t("warning", r, "crop-marks needs bleed to draw into — trim marks sit outside the page box.", 'Add bleed="3" (mm), or drop crop-marks.', "crop-marks");
|
|
2455
|
+
const s = H(r, "safe-zone");
|
|
2416
2456
|
if (s != null && s > 0) {
|
|
2417
2457
|
const h = ct(r.getAttribute("size"), r.getAttribute("width"), r.getAttribute("height"), r.getAttribute("orientation"));
|
|
2418
2458
|
s * 2 >= Math.min(h.widthMm, h.heightMm) && t("warning", r, `safe-zone=${s}mm leaves no usable area on a ${h.widthMm} × ${h.heightMm} mm page.`, "Use a smaller inset — 5–10mm is typical.", "safe-zone");
|
|
2419
2459
|
}
|
|
2420
2460
|
const o = r.getAttribute("format");
|
|
2421
2461
|
o == null ? t("warning", r, "No format= on the cartograph root.", `Add format="${pt}" so future runtimes can migrate this document.`, "format") : o !== pt && t("warning", r, `Unrecognised document format "${o}".`, `This build understands "${pt}".`, "format");
|
|
2422
|
-
const { widthMm: a, heightMm: l } = ct(e, r.getAttribute("width"), r.getAttribute("height"), r.getAttribute("orientation")), c = Math.max(0,
|
|
2462
|
+
const { widthMm: a, heightMm: l } = ct(e, r.getAttribute("width"), r.getAttribute("height"), r.getAttribute("orientation")), c = Math.max(0, H(r, "bleed") ?? 0), u = /* @__PURE__ */ new Set(), m = [...r.querySelectorAll("om-frame")];
|
|
2423
2463
|
for (const h of m)
|
|
2424
2464
|
h.id ? u.add(h.id) : t("error", h, "Frame has no id.", "Give every frame an id so furniture can reference it with for=.", "id");
|
|
2425
2465
|
for (const h of r.children) {
|
|
2426
|
-
if (
|
|
2466
|
+
if (Nn.some((p) => h.hasAttribute(p))) continue;
|
|
2427
2467
|
const f = h.tagName.toLowerCase();
|
|
2428
|
-
!gt.includes(f) && !
|
|
2468
|
+
!gt.includes(f) && !En.has(f) && t("error", h, `<${f}> is not a cartograph element.`, `Use one of ${gt.join(", ")}, or move this content inside an <om-text>.`);
|
|
2429
2469
|
}
|
|
2430
2470
|
const d = [];
|
|
2431
2471
|
for (const h of [r, ...r.querySelectorAll("*")]) {
|
|
2432
2472
|
const f = h.tagName.toLowerCase();
|
|
2433
2473
|
if (gt.includes(f) && !h.closest("om-map")) {
|
|
2434
|
-
if (
|
|
2435
|
-
const p =
|
|
2436
|
-
|
|
2474
|
+
if (On(h, f, t), Tn.has(f)) {
|
|
2475
|
+
const p = S(h);
|
|
2476
|
+
Un(h, p, a, l, c, t), Pn.has(f) && !h.hasAttribute("hidden") && d.push({ el: h, box: p });
|
|
2437
2477
|
}
|
|
2438
|
-
f === "om-frame" &&
|
|
2478
|
+
f === "om-frame" && zn(h, t), f === "om-legend" && jn(h, m, t), f === "om-atlas" && Dn(h, m, t), f === "om-scalebar" && Gn(h, m, t), f === "om-text" && qn(h, m, t);
|
|
2439
2479
|
for (const p of ["for", "overview-of"]) {
|
|
2440
2480
|
const g = h.getAttribute(p);
|
|
2441
2481
|
g && !u.has(g) && t("error", h, `${p}="${g}" references no frame on this page.`, `Point it at one of: ${[...u].join(", ") || "(no frames)"}.`, p);
|
|
@@ -2445,7 +2485,7 @@ function Rn(r, t) {
|
|
|
2445
2485
|
for (let h = 0; h < d.length; h++)
|
|
2446
2486
|
for (let f = h + 1; f < d.length; f++) {
|
|
2447
2487
|
const p = d[h], g = d[f];
|
|
2448
|
-
p.box.w <= 0 || p.box.h <= 0 || g.box.w <= 0 || g.box.h <= 0 ||
|
|
2488
|
+
p.box.w <= 0 || p.box.h <= 0 || g.box.w <= 0 || g.box.h <= 0 || In(p.box, g.box) && t(
|
|
2449
2489
|
"warning",
|
|
2450
2490
|
p.el,
|
|
2451
2491
|
`Overlaps ${Ye(g.el)} on the page.`,
|
|
@@ -2453,7 +2493,7 @@ function Rn(r, t) {
|
|
|
2453
2493
|
);
|
|
2454
2494
|
}
|
|
2455
2495
|
}
|
|
2456
|
-
function
|
|
2496
|
+
function On(r, t, e) {
|
|
2457
2497
|
const n = new Set(P[t] ?? []);
|
|
2458
2498
|
for (const i of r.attributes) {
|
|
2459
2499
|
const s = i.name.toLowerCase();
|
|
@@ -2466,7 +2506,7 @@ function _n(r, t, e) {
|
|
|
2466
2506
|
e("warning", r, `Unknown attribute "${s}" on <${t}> — likely a typo.`, `Valid attributes: ${[...n].join(", ")}.`, s);
|
|
2467
2507
|
}
|
|
2468
2508
|
}
|
|
2469
|
-
function
|
|
2509
|
+
function Un(r, t, e, n, i, s) {
|
|
2470
2510
|
if (t.w <= 0 || t.h <= 0) {
|
|
2471
2511
|
s("error", r, `Element has no size (w=${t.w}, h=${t.h}).`, "Give w= and h= in millimetres — both greater than zero.", t.w <= 0 ? "w" : "h");
|
|
2472
2512
|
return;
|
|
@@ -2485,7 +2525,7 @@ function On(r, t, e, n, i, s) {
|
|
|
2485
2525
|
["height", t.h]
|
|
2486
2526
|
];
|
|
2487
2527
|
for (const [u, m] of c) {
|
|
2488
|
-
const d =
|
|
2528
|
+
const d = Rn(r, u);
|
|
2489
2529
|
d != null && Math.abs(d - m) > 0.01 && s(
|
|
2490
2530
|
"error",
|
|
2491
2531
|
r,
|
|
@@ -2495,7 +2535,7 @@ function On(r, t, e, n, i, s) {
|
|
|
2495
2535
|
);
|
|
2496
2536
|
}
|
|
2497
2537
|
}
|
|
2498
|
-
function
|
|
2538
|
+
function zn(r, t) {
|
|
2499
2539
|
if ((r.getAttribute("mode") === "static" ? "static" : "live") === "static") {
|
|
2500
2540
|
const n = r.getAttribute("corners"), i = mt(n);
|
|
2501
2541
|
i || t(
|
|
@@ -2505,14 +2545,14 @@ function Un(r, t) {
|
|
|
2505
2545
|
'Give four lon/lat pairs in tl, tr, br, bl order — corners="[[lng,lat],[lng,lat],[lng,lat],[lng,lat]]".',
|
|
2506
2546
|
"corners"
|
|
2507
2547
|
), r.querySelector(":scope > img") || t("error", r, "Static frame has no <img> child to place.", "Add the georeferenced raster as an <img> child — it is also what renders with JavaScript disabled.");
|
|
2508
|
-
const s =
|
|
2548
|
+
const s = S(r), o = K(r.getAttribute("crs"));
|
|
2509
2549
|
if (i && o && s.w > 0 && s.h > 0) {
|
|
2510
2550
|
const a = ht({ corners: i, widthMm: s.w, heightMm: s.h, crsForward: o });
|
|
2511
2551
|
if (a.degenerate)
|
|
2512
2552
|
t("error", r, "Frame corners are degenerate (collinear or coincident) — nothing can be placed on this frame.", "Check the corner order: tl, tr, br, bl.", "corners");
|
|
2513
2553
|
else {
|
|
2514
2554
|
const l = Br(a);
|
|
2515
|
-
l != null && l >
|
|
2555
|
+
l != null && l > Ln && t(
|
|
2516
2556
|
"warning",
|
|
2517
2557
|
r,
|
|
2518
2558
|
`Ground scale varies ${(l * 100).toFixed(1)}% across this frame, so a single scale bar is only true near its anchor.`,
|
|
@@ -2521,7 +2561,7 @@ function Un(r, t) {
|
|
|
2521
2561
|
}
|
|
2522
2562
|
}
|
|
2523
2563
|
} else {
|
|
2524
|
-
|
|
2564
|
+
Q(r) || t(
|
|
2525
2565
|
"error",
|
|
2526
2566
|
r,
|
|
2527
2567
|
"Live frame has no valid camera.",
|
|
@@ -2540,12 +2580,12 @@ function Un(r, t) {
|
|
|
2540
2580
|
n && n !== "EPSG:3857" && t("error", r, `Live frame declares ${n}, but live frames render EPSG:3857.`, 'Use mode="static" with a georeferenced raster for other projections.', "crs");
|
|
2541
2581
|
}
|
|
2542
2582
|
}
|
|
2543
|
-
function
|
|
2583
|
+
function _t(r, t) {
|
|
2544
2584
|
const e = r.getAttribute("for");
|
|
2545
2585
|
return e ? t.find((n) => n.id === e) : t.length === 1 ? t[0] : void 0;
|
|
2546
2586
|
}
|
|
2547
2587
|
function jn(r, t, e) {
|
|
2548
|
-
const n = r.getAttribute("derived") !== "false", i =
|
|
2588
|
+
const n = r.getAttribute("derived") !== "false", i = _t(r, t);
|
|
2549
2589
|
n && i?.getAttribute("mode") === "static" && e(
|
|
2550
2590
|
"warning",
|
|
2551
2591
|
r,
|
|
@@ -2566,10 +2606,10 @@ function jn(r, t, e) {
|
|
|
2566
2606
|
);
|
|
2567
2607
|
}
|
|
2568
2608
|
}
|
|
2569
|
-
function
|
|
2609
|
+
function Dn(r, t, e) {
|
|
2570
2610
|
const n = r.getAttribute("layer");
|
|
2571
2611
|
n || e("error", r, "Atlas has no layer= to iterate.", 'Name a layer inside the frame, e.g. layer="parcels".', "layer");
|
|
2572
|
-
const i = r.getAttribute("for"), s =
|
|
2612
|
+
const i = r.getAttribute("for"), s = _t(r, t);
|
|
2573
2613
|
if (!s) {
|
|
2574
2614
|
!i && t.length !== 1 && e("error", r, `Atlas does not say which frame drives it, and the page has ${t.length} frames.`, 'Add for="<frame id>".', "for");
|
|
2575
2615
|
return;
|
|
@@ -2601,17 +2641,17 @@ function zn(r, t, e) {
|
|
|
2601
2641
|
);
|
|
2602
2642
|
}
|
|
2603
2643
|
}
|
|
2604
|
-
function
|
|
2605
|
-
const n =
|
|
2644
|
+
function Gn(r, t, e) {
|
|
2645
|
+
const n = H(r, "segment-length");
|
|
2606
2646
|
if (n == null) return;
|
|
2607
|
-
const i =
|
|
2647
|
+
const i = _t(r, t);
|
|
2608
2648
|
if (!i) return;
|
|
2609
|
-
const s = mt(i.getAttribute("corners")), o = K(i.getAttribute("crs")), a =
|
|
2649
|
+
const s = mt(i.getAttribute("corners")), o = K(i.getAttribute("crs")), a = S(i);
|
|
2610
2650
|
if (!s || !o || a.w <= 0 || a.h <= 0) return;
|
|
2611
|
-
const l = ht({ corners: s, widthMm: a.w, heightMm: a.h, crsForward: o }), c =
|
|
2651
|
+
const l = ht({ corners: s, widthMm: a.w, heightMm: a.h, crsForward: o }), c = S(r), u = $e({
|
|
2612
2652
|
groundMetersPerMm: l.groundMetersPerMm(),
|
|
2613
2653
|
maxWidthMm: c.w,
|
|
2614
|
-
segments:
|
|
2654
|
+
segments: H(r, "segments") ?? void 0,
|
|
2615
2655
|
segmentLengthMeters: n
|
|
2616
2656
|
});
|
|
2617
2657
|
u && u.totalMm > c.w + 1e-6 && e(
|
|
@@ -2622,9 +2662,9 @@ function Dn(r, t, e) {
|
|
|
2622
2662
|
"segment-length"
|
|
2623
2663
|
);
|
|
2624
2664
|
}
|
|
2625
|
-
function
|
|
2665
|
+
function qn(r, t, e) {
|
|
2626
2666
|
const n = r.textContent ?? "", i = /* @__PURE__ */ new Set(["title", "attribution", "date", "notes", "scale", "crs"]), s = new Set(t.map((o) => o.id).filter(Boolean));
|
|
2627
|
-
for (const o of
|
|
2667
|
+
for (const o of kr(n))
|
|
2628
2668
|
if (!o.startsWith("atlas.")) {
|
|
2629
2669
|
if (o.startsWith("frame.")) {
|
|
2630
2670
|
const a = o.slice(6), l = a.lastIndexOf("."), c = l > 0 ? a.slice(0, l) : "", u = l > 0 ? a.slice(l + 1) : "";
|
|
@@ -2643,10 +2683,10 @@ function Gn(r, t, e) {
|
|
|
2643
2683
|
i.has(o) || e("warning", r, `Unknown token {{${o}}} — it will render literally.`, `Known tokens: ${[...i].join(", ")}, frame.<id>.scale, frame.<id>.crs, atlas.<field>.`);
|
|
2644
2684
|
}
|
|
2645
2685
|
}
|
|
2646
|
-
function
|
|
2686
|
+
function Yn(r) {
|
|
2647
2687
|
return Ke(pr(r));
|
|
2648
2688
|
}
|
|
2649
|
-
async function
|
|
2689
|
+
async function Kn(r) {
|
|
2650
2690
|
const t = Ke(r), e = [...r.querySelectorAll("om-frame")].filter((a) => a.querySelector(":scope > om-map"));
|
|
2651
2691
|
if (e.length === 0) return t;
|
|
2652
2692
|
const { loadCore: n } = await Promise.resolve().then(() => Je), i = await n(), s = [...t.errors], o = [...t.warnings];
|
|
@@ -2657,8 +2697,8 @@ async function Yn(r) {
|
|
|
2657
2697
|
}
|
|
2658
2698
|
return { valid: s.length === 0, errors: s, warnings: o };
|
|
2659
2699
|
}
|
|
2660
|
-
function
|
|
2661
|
-
x("om-cartograph", Fe), x("om-text", Ie), x("om-frame", Ue), x("om-scalebar",
|
|
2700
|
+
function Xn() {
|
|
2701
|
+
x("om-cartograph", Fe), x("om-text", Ie), x("om-frame", Ue), x("om-scalebar", ze), x("om-north", je), x("om-shape", De), x("om-image", Ge), x("om-legend", We), x("om-graticule", Ve), x("om-atlas", He);
|
|
2662
2702
|
}
|
|
2663
2703
|
ye(() => import("@nika-js/onlymap"));
|
|
2664
2704
|
dr();
|
|
@@ -2666,9 +2706,9 @@ export {
|
|
|
2666
2706
|
P as CARTOGRAPH_ELEMENT_ATTRS,
|
|
2667
2707
|
pt as CARTOGRAPH_FORMAT,
|
|
2668
2708
|
gt as CARTOGRAPH_TAG_NAMES,
|
|
2669
|
-
|
|
2709
|
+
Wn as CARTOGRAPH_THEMES,
|
|
2670
2710
|
ir as COLLAPSE_THRESHOLD,
|
|
2671
|
-
|
|
2711
|
+
It as CVD_MATRICES,
|
|
2672
2712
|
dt as CVD_TYPES,
|
|
2673
2713
|
rr as CVD_VALUES,
|
|
2674
2714
|
Be as GEOGRAPHIC_PLANE,
|
|
@@ -2682,43 +2722,43 @@ export {
|
|
|
2682
2722
|
Ve as OmGraticuleElement,
|
|
2683
2723
|
Ge as OmImageElement,
|
|
2684
2724
|
We as OmLegendElement,
|
|
2685
|
-
|
|
2686
|
-
|
|
2725
|
+
je as OmNorthElement,
|
|
2726
|
+
ze as OmScalebarElement,
|
|
2687
2727
|
De as OmShapeElement,
|
|
2688
2728
|
Ie as OmTextElement,
|
|
2689
|
-
|
|
2690
|
-
|
|
2729
|
+
Ut as PAGE_PRESETS,
|
|
2730
|
+
Vt as PAGE_SIZE_NAMES,
|
|
2691
2731
|
j as PLACED_ATTR_NAMES,
|
|
2692
|
-
|
|
2732
|
+
z as PX_PER_MM,
|
|
2693
2733
|
Sr as SCALE_GROUP_SEPARATOR,
|
|
2694
2734
|
hr as URL_ACTION_TIMEOUT_MS,
|
|
2695
2735
|
Fr as alignOffset,
|
|
2696
2736
|
Le as allFrames,
|
|
2697
2737
|
sr as applyCvdToCanvas,
|
|
2698
|
-
|
|
2738
|
+
$r as applyTokens,
|
|
2699
2739
|
mr as applyUrlActions,
|
|
2700
|
-
|
|
2701
|
-
|
|
2702
|
-
|
|
2703
|
-
|
|
2740
|
+
Lt as atlasFields,
|
|
2741
|
+
Hn as boundsArea,
|
|
2742
|
+
S as boxMm,
|
|
2743
|
+
hn as buildGraticule,
|
|
2704
2744
|
Mn as buildPages,
|
|
2705
|
-
|
|
2745
|
+
$e as buildScalebar,
|
|
2706
2746
|
Ar as buildScalebarDrawing,
|
|
2707
2747
|
K as builtinCrsForward,
|
|
2708
|
-
|
|
2748
|
+
Bn as canvasMeasurer,
|
|
2709
2749
|
Pr as clearUnlinked,
|
|
2710
|
-
|
|
2711
|
-
|
|
2750
|
+
Vn as cornersFromBounds,
|
|
2751
|
+
Pt as cornersFromCamera,
|
|
2712
2752
|
ht as createFrameGeoref,
|
|
2713
2753
|
er as createZip,
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2754
|
+
Xn as defineCartographElements,
|
|
2755
|
+
Gt as deltaE00,
|
|
2756
|
+
an as deriveLegendRows,
|
|
2717
2757
|
ar as ensureCvdFilters,
|
|
2718
|
-
|
|
2758
|
+
wn as featureBounds,
|
|
2719
2759
|
I as fieldOf,
|
|
2720
2760
|
Te as findFrame,
|
|
2721
|
-
|
|
2761
|
+
fn as formatDms,
|
|
2722
2762
|
Cr as formatScaleDenominator,
|
|
2723
2763
|
dr as installUrlActions,
|
|
2724
2764
|
Ze as isCoreLoaded,
|
|
@@ -2726,43 +2766,44 @@ export {
|
|
|
2726
2766
|
Lr as layoutText,
|
|
2727
2767
|
or as lintLegendColours,
|
|
2728
2768
|
we as loadCore,
|
|
2769
|
+
Kr as maxGeoreferenceablePitch,
|
|
2729
2770
|
_r as mercatorForward,
|
|
2730
2771
|
Or as mercatorInverse,
|
|
2731
2772
|
de as niceInterval,
|
|
2732
|
-
|
|
2773
|
+
ke as niceNumberBelow,
|
|
2733
2774
|
Y as normalizeCrs,
|
|
2734
2775
|
Wr as northBearingDegrees,
|
|
2735
2776
|
Pe as ownerCartograph,
|
|
2736
|
-
|
|
2737
|
-
|
|
2777
|
+
vn as padBounds,
|
|
2778
|
+
Ot as paintEnvForDpi,
|
|
2738
2779
|
nr as parseColor,
|
|
2739
2780
|
mt as parseCorners,
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2781
|
+
Sn as parseSort,
|
|
2782
|
+
G as peekCore,
|
|
2783
|
+
Q as readCamera,
|
|
2743
2784
|
qe as readLiteralRows,
|
|
2744
|
-
|
|
2785
|
+
un as readOverrides,
|
|
2745
2786
|
O as referencedFrame,
|
|
2746
|
-
|
|
2747
|
-
|
|
2787
|
+
yn as rejectionFor,
|
|
2788
|
+
Rt as renderCartograph,
|
|
2748
2789
|
Ce as renderCartographAtlas,
|
|
2749
2790
|
Oe as resolveCrsForward,
|
|
2750
|
-
|
|
2751
|
-
|
|
2791
|
+
Ft as resolveCvdType,
|
|
2792
|
+
kn as resolveFilenames,
|
|
2752
2793
|
ct as resolvePageSize,
|
|
2753
2794
|
xr as resolveToken,
|
|
2754
2795
|
Ne as resolveTokens,
|
|
2755
|
-
|
|
2796
|
+
sn as rowColorFor,
|
|
2756
2797
|
Hr as sanitizeAdoptedMap,
|
|
2757
|
-
|
|
2798
|
+
xn as sanitizeFilename,
|
|
2758
2799
|
Br as scaleVariation,
|
|
2759
2800
|
ye as setCoreLoader,
|
|
2760
2801
|
jt as simulate,
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2802
|
+
on as swatchShapeFor,
|
|
2803
|
+
kr as tokensIn,
|
|
2804
|
+
ie as utmDef,
|
|
2764
2805
|
Ke as validateCartograph,
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2806
|
+
Kn as validateCartographDeep,
|
|
2807
|
+
Yn as validateCartographString,
|
|
2808
|
+
Bt as whenPageReady
|
|
2768
2809
|
};
|