@nika-js/onlymap 0.12.0 → 0.13.0
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 +44 -0
- package/README.md +1 -1
- package/dist/{basemap-CtDse0mW.js → basemap-BxqFTBzX.js} +2 -2
- package/dist/build-D4iI8O9b.js +208 -0
- package/dist/cartograph.js +43 -41
- package/dist/cartograph.standalone.js +3 -1
- package/dist/client-BYFePLZV.js +6878 -0
- package/dist/{geoparquet-BTHYX1ET.js → geoparquet-BV32P0nI.js} +1 -1
- package/dist/{globe-view-KrKNOmVs.js → globe-view-B_X6obse.js} +6 -6
- package/dist/{hillshade-CijRdYyU.js → hillshade-9VS_t-Ks.js} +79 -67
- package/dist/hillshade.d.ts +7 -0
- package/dist/html-data.d.ts +1 -1
- package/dist/{index-21KGElDr.js → index-BR_5FIN1.js} +3 -3
- package/dist/{index-eHYe06mM.js → index-Bct9VWxi.js} +1 -1
- package/dist/index-CbFw6P0B.js +4449 -0
- package/dist/{index-Bfocr1_A.js → index-D3P6Cfbr.js} +38 -38
- package/dist/{index-A45DtXly.js → index-D40H3fpl.js} +54 -54
- package/dist/{index-DoGY-Vgi.js → index-Di1LK4JT.js} +3 -3
- package/dist/{index-DMc81n9B.js → index-IDWDfgTC.js} +33429 -30673
- package/dist/{index-DS6VUGi6.js → index-JewSBOjJ.js} +49 -49
- package/dist/{index-BPa2CC8T.js → index-eSuCj2Bn.js} +42 -42
- package/dist/layer-registry.d.ts +1 -0
- package/dist/{lerc-DjrPALEj.js → lerc-C42a0ISa.js} +1 -1
- package/dist/onlymap.standalone.js +60636 -51605
- package/dist/onlymapjs.js +47 -47
- package/dist/plane-gpu/gpu-layer-types.d.ts +35 -0
- package/dist/plane-gpu/plane-basemap.d.ts +10461 -0
- package/dist/plane-gpu/plane-gpu-view.d.ts +90 -0
- package/dist/plane-gpu/projection-params.d.ts +47 -0
- package/dist/plane-layers.d.ts +2 -0
- package/dist/plane-seam.d.ts +48 -0
- package/dist/plane-tileset.d.ts +23 -2
- package/dist/plane-vector/build.d.ts +107 -0
- package/dist/plane-vector/client.d.ts +18 -0
- package/dist/plane-vector/cut-ends-extension.d.ts +30 -0
- package/dist/plane-vector/plane-mvt-layer.d.ts +10412 -0
- package/dist/plane-vector/tile-cut.d.ts +45 -0
- package/dist/plane-vector/worker.d.ts +15 -0
- package/dist/plane-warp.d.ts +12 -1
- package/dist/{post-process-effect-Be1qa2DD.js → post-process-effect-ktcgAjmv.js} +11 -11
- package/dist/programmatic.d.ts +6 -0
- package/dist/projection.d.ts +51 -0
- package/dist/{raster-zC3qXBrs.js → raster-CIxg_M_1.js} +3 -3
- package/dist/{raster-pipeline-DspBYxwc.js → raster-pipeline-BODPC9vJ.js} +1 -1
- package/dist/react/om-map.d.ts +4 -0
- package/dist/react.js +259 -252
- package/dist/runtime-core.d.ts +84 -2
- package/dist/{text-on-path-D0_URrD2.js → text-on-path-LZL6NfwZ.js} +74 -66
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-DopOhzfY.js → zarr-D19fNIZt.js} +2 -2
- package/docs/cartograph.md +2 -2
- package/docs/cartography.md +59 -3
- package/docs/testing.md +2 -1
- package/llms.txt +2 -2
- package/onlymapjs.attributes.json +1 -0
- package/onlymapjs.html-data.json +15 -1
- package/package.json +3 -2
- package/skills/onlymapjs/SKILL.md +2 -2
- package/skills/onlymapjs/references/syntax.md +7 -6
- package/dist/index-B_Vhebf7.js +0 -4883
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,50 @@ Note: npm collapsed a few closely-spaced releases — the GPX/FlatGeobuf (0.5.4)
|
|
|
8
8
|
and GeoParquet (0.5.5) work shipped to npm together as **0.5.6**, so npm's
|
|
9
9
|
version list jumps 0.5.3 → 0.5.6. Each logical version is listed here regardless.
|
|
10
10
|
|
|
11
|
+
## 0.13.0 — 2026-10-15
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
- **Projected maps are drawn by the GPU.** On a `crs` in the Transverse Mercator/UTM, Albers, Lambert Conformal Conic or Lambert Azimuthal Equal Area families — British National Grid, any UTM zone, NZTM, SVY21, CONUS and Australian Albers, Lambert-93, LAEA Europe, and grids on other ellipsoids or prime meridians — every point is placed by the graphics card, within a quarter of a pixel of proj4, on real GPUs and in software rendering alike. Layers keep their longitude/latitude, so the map draws as fast as in Web Mercator. Other projections draw as before, on the CPU. `OmMap.configureCrs({ gpuProjection: false })` turns the GPU path off.
|
|
15
|
+
- **`crs` is live.** Change it on a mounted map — the attribute, the `set-crs` action (`{ crs: "mercator" }` goes back), `MapController.setCrs`, or React's `crs` prop — and every layer re-projects in place with the camera where it was; a story step can switch the sheet's projection, and undo restores it. Between two GPU-drawn grids nothing is re-projected at all (polygon fills are triangulated again), and tiled layers keep the tiles they have. A `crs` that cannot resolve is reported and the map stays as it was.
|
|
16
|
+
- **Vector tiles on any projected map.** `MVTLayer` now works under every `crs`: each tile is cut to its edge, projected and triangulated off the main thread, so panning costs what it does in Web Mercator and a tile never freezes the page as it arrives. A `crs` switch rebuilds cached tiles without fetching them again.
|
|
17
|
+
- **A vector basemap on a projected map.** `basemap="positron"`, `"liberty"` or `"bright"` on any `crs` draws OpenFreeMap's vector tiles in the projection, in the preset's colours — land, water, parks, buildings, roads, rail, boundaries; no labels yet — credited automatically. Switching the preset recolours in place.
|
|
18
|
+
- **`color-domain` on `ScreenGridLayer`** fixes the value range its colour scale spans, as the other aggregation layers already allowed; it also makes a busy map pan more smoothly, since the layer no longer re-reads its range from the GPU on every camera move.
|
|
19
|
+
- **Two new examples:** *Switch the projection* (Singapore baselines measured in every plane against the WGS84 ellipsoid) and the *Projected map debugger* — every layer type on every projection family, with a readout of how each is drawn.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
- **A geographic `crs` (`EPSG:4326`, NAD83, ETRS89, a `+proj=longlat` definition) is a warning, not an error.** It draws as plate carrée — one scale in degrees on both axes, as QGIS or ArcGIS draw an unprojected layout — which is exactly what a cartograph copying such a layout needs; the warning names the longitude stretch at your centre latitude. It used to be refused outright, and only for three codes.
|
|
23
|
+
- **Relief, image tiles and vector tiles on a projected map load only the tiles that meet the view.** Panning a projected map fetched and drew about two and a half times the tiles it showed.
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
- **A country straddling a projection's seam no longer draws as a wedge across the map.** On CONUS Albers, Russia reached across Hudson Bay and the Arctic; polygons and lines are now cut at the seam, for GeoJSON and for CSV rows with `get-polygon`/`get-path` alike, each piece keeping its properties.
|
|
27
|
+
- **Polygons far from a projection's central meridian draw with solid fills** instead of fans of overlapping and missing triangles.
|
|
28
|
+
- **Data past a projection's range no longer breaks a whole layer, and never draws a line across the gap.** A Transverse Mercator map with world data in it works in Firefox, where it failed with "invalid array length" (ContourLayer) and "source array is too long" (TripsLayer).
|
|
29
|
+
- **Image tiles past a projection's range no longer throw** ("Illegal attribute generated for positions") when switching to some projections, and no longer draw the far side of the world folded over the near one.
|
|
30
|
+
- **Scrolling a projected map with a vector basemap no longer logs "Picked non-existent layer".**
|
|
31
|
+
- **A `crs` switch that fails leaves the map as it was** — including a map with a MapLibre basemap, which went blank — and keeps reporting its previous `crs`.
|
|
32
|
+
- **A heatmap on a GPU-drawn projected map panned at 4 frames a second**; it draws at full speed again.
|
|
33
|
+
- **The world-countries example data drew wedges over the Arctic** on every projection: islands were recorded as holes of one polygon. Repaired.
|
|
34
|
+
|
|
35
|
+
## 0.12.1 — 2026-10-12
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
- **The library reports its own version correctly.** 0.12.0 identified itself as 0.11.11 — to anything that reads the runtime version, and in its usage reports — and its package shipped without the 0.12.0 changelog entry. Both are right in 0.12.1; nothing else changes.
|
|
39
|
+
|
|
40
|
+
## 0.12.0 — 2026-10-09
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- **Data in any coordinate system lands in the right place.** Files in a national grid, State Plane or UTM zone — eastings and northings in metres — are converted to longitude/latitude as they load, instead of drawing in the ocean. A file that names its own system needs nothing: a shapefile's `.prj`, a FlatGeobuf or GeoParquet header, or a GeoJSON `crs` member is read automatically. For a CSV, or to override the file, declare it on the layer: `<om-layer crs="EPSG:27700">`. Common grids and every UTM zone are built in; any other EPSG code is looked up at epsg.io once (`OmMap.configureCrs({ online: false })` turns that off). GeoParquet in a local grid now loads instead of being refused. Coordinates that cannot be degrees, with no system named, are reported rather than drawn somewhere wrong.
|
|
44
|
+
- **Satellite and other image tiles on a projected map.** On a map drawn in a real projection (`crs="EPSG:27700"` on `<om-map>`), an image `TileLayer` (`…/{z}/{x}/{y}.png`, `.jpg`, `.webp`) is now warped into the projection and lands within a pixel of where it belongs — so a projected map can have a satellite or OpenStreetMap backdrop. `basemap="satellite"` itself stays a validation error there, and its fix is that imagery written as a layer, plus its credit line.
|
|
45
|
+
- **A globe (preview).** `projection="globe"` on a map with a basemap draws the Earth as a sphere you can spin; zoom in and it becomes the ordinary flat map. Layers, data and the camera are written exactly as before, it switches live (the attribute, the `set-projection` action, `MapController.setProjection`, or React's `projection` prop), overlays on the far side hide, and a click in space reports no coordinate. A globe is drawn flat-on and north-up, and text, icon, arc and heatmap-style layers cannot draw on it yet — validation says so, with a fix.
|
|
46
|
+
- **Two new examples:** map British National Grid data on a satellite map and on a map drawn in the grid itself, and spin a satellite globe with great-circle routes.
|
|
47
|
+
|
|
48
|
+
### Fixed
|
|
49
|
+
- **Relief on a projected map sits where it belongs.** It was drawn a few pixels south of its true position at low zoom.
|
|
50
|
+
- **A mouse-wheel zoom on a map with a basemap now reports itself as the user's move.** `om-view-changed` said `"programmatic"` for it, so apps (and linked maps) that only follow user moves missed it.
|
|
51
|
+
- **A fixed-position `<om-overlay>` on a map with a basemap shows as soon as the map loads**, instead of staying hidden until the first pan.
|
|
52
|
+
- **The live validation report now includes the map's own checks** — basemap, projection and widget-placement problems on `<om-map>` itself appeared in the static validator but were left out of the on-page panel and `getDiagnostics()`.
|
|
53
|
+
- **No more "renders nothing" warning for a widget that holds its own HTML.** An `<om-widget>` with no `type` but its own content renders that content; only an empty one is flagged.
|
|
54
|
+
|
|
11
55
|
## 0.11.11 — 2026-10-08
|
|
12
56
|
|
|
13
57
|
### Fixed
|
package/README.md
CHANGED
|
@@ -392,7 +392,7 @@ Two things it gets right that hand-rolled hillshades usually don't. **Tile edges
|
|
|
392
392
|
</om-map>
|
|
393
393
|
```
|
|
394
394
|
|
|
395
|
-
**The authored camera stays geographic.** `center` is lng/lat and `zoom` means what it always meant, so stories, `seek()`, `getCamera()` and every state bridge keep working; clicks report lng/lat rather than plane metres, which matters because a projected metre in a geodesic formula returns a confident wrong distance. Web Mercator and plate carrée need nothing; the national grids and UTM zones load proj4 only when a map asks for one; anything else takes `crs-def="+proj=…"` or `registerCrs()`. What a projected map can't do — MapLibre basemaps, `terrain`, pitch, spatial-index layers
|
|
395
|
+
**The authored camera stays geographic.** `center` is lng/lat and `zoom` means what it always meant, so stories, `seek()`, `getCamera()` and every state bridge keep working; clicks report lng/lat rather than plane metres, which matters because a projected metre in a geodesic formula returns a confident wrong distance. Web Mercator and plate carrée need nothing; the national grids and UTM zones load proj4 only when a map asks for one; anything else takes `crs-def="+proj=…"` or `registerCrs()`. `crs` is live: change it on a mounted map (or with the `set-crs` action) and every layer re-projects in place, no reload, camera untouched — and between two grids the GPU draws nothing is re-projected at all (polygon fills are triangulated again, for the new plane). The GPU draws Transverse Mercator (British National Grid, NZTM, SVY21, any UTM zone), Albers, Lambert Conformal Conic and Lambert Azimuthal Equal Area grids: layers keep their lng/lat and placement agrees with proj4js to a fraction of a pixel; `OmMap.configureCrs({ gpuProjection: false })` puts every projected map back on the CPU. `MVTLayer` vector tiles work on any projected map — each tile is cut to its edge, projected and triangulated once, off the main thread, so panning costs what it does in Web Mercator — and so does `basemap="positron"`, `"liberty"` or `"bright"`: OpenFreeMap's vector tiles drawn in the plane in the preset's colours (land, water, roads, boundaries — no labels yet), credited automatically. What a projected map can't do — other MapLibre basemaps, `terrain`, pitch, a clip box, spatial-index layers — is a validation error with a fix, never a silent no-op.
|
|
396
396
|
|
|
397
397
|
**Relief works on a projected sheet**, both ways: a DEM of your own has no projection tie at all, and the keyless global `HillshadeLayer` re-indexes its Mercator tiles from the plane's own geography and draws them as subdivided warped meshes (measured sub-pixel — 0.40 output pixels for Albers at z=3, falling as 1/N²). `sun-datum` picks which north the sun means: sheet north by default, because geographic north swings 34° across a CONUS plate and light that rotates reads as a mistake.
|
|
398
398
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as iy } from "./globe-view-
|
|
1
|
+
import { aQ as Y_, N as Ou, H as Id, k as K_, aR as J_, aS as Q_, D as Yf, Z as ey, aT as ty } from "./index-IDWDfgTC.js";
|
|
2
|
+
import { a as iy } from "./globe-view-B_X6obse.js";
|
|
3
3
|
const ry = /* @__PURE__ */ new Set(["tile.openstreetmap.org", "a.tile.openstreetmap.org", "b.tile.openstreetmap.org", "c.tile.openstreetmap.org"]);
|
|
4
4
|
function ny(Ie) {
|
|
5
5
|
let Q;
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { ah as j, ai as T, aj as B, ak as E, al as q } from "./index-IDWDfgTC.js";
|
|
2
|
+
const N = (l) => Number.isFinite(l[0]) && Number.isFinite(l[1]);
|
|
3
|
+
function O(l, t, s) {
|
|
4
|
+
const o = T(s.x, s.y, s.z), i = 8, n = [];
|
|
5
|
+
let p = !0;
|
|
6
|
+
for (let e = 0; e <= i; e++) {
|
|
7
|
+
const r = [];
|
|
8
|
+
for (let F = 0; F <= i; F++) {
|
|
9
|
+
const I = o.west + (o.east - o.west) * e / i, M = o.south + (o.north - o.south) * F / i, S = l(I, M);
|
|
10
|
+
(!N(S) || t && !U(I, M, S, t)) && (p = !1), r.push(S);
|
|
11
|
+
}
|
|
12
|
+
n.push(r);
|
|
13
|
+
}
|
|
14
|
+
const u = [];
|
|
15
|
+
for (let e = 0; e <= i; e++)
|
|
16
|
+
for (let r = 0; r <= i; r++)
|
|
17
|
+
e < i && u.push(Math.hypot(n[e + 1][r][0] - n[e][r][0], n[e + 1][r][1] - n[e][r][1])), r < i && u.push(Math.hypot(n[e][r + 1][0] - n[e][r][0], n[e][r + 1][1] - n[e][r][1]));
|
|
18
|
+
const a = u.filter(Number.isFinite).sort((e, r) => e - r), g = a[a.length >> 1] ?? 0, d = a.length < u.length || a[a.length - 1] > 20 * g, c = p || !t ? l : (e, r) => {
|
|
19
|
+
const F = l(e, r);
|
|
20
|
+
return N(F) && U(e, r, F, t) ? F : [NaN, NaN];
|
|
21
|
+
};
|
|
22
|
+
return { project: c, tears: d ? (e, r, F, I) => V(e, r, F, I, c) : null };
|
|
23
|
+
}
|
|
24
|
+
function U(l, t, s, o) {
|
|
25
|
+
try {
|
|
26
|
+
return q(l, t, o(s[0], s[1]));
|
|
27
|
+
} catch {
|
|
28
|
+
return !1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function V(l, t, s, o, i) {
|
|
32
|
+
const n = Math.hypot(o[0] - s[0], o[1] - s[1]);
|
|
33
|
+
if (!(n > 0)) return !1;
|
|
34
|
+
let p = s;
|
|
35
|
+
for (let u = 1; u <= 4; u++) {
|
|
36
|
+
const a = u === 4 ? o : i(l[0] + (t[0] - l[0]) * u / 4, l[1] + (t[1] - l[1]) * u / 4);
|
|
37
|
+
if (!N(a) || Math.hypot(a[0] - p[0], a[1] - p[1]) > 0.75 * n) return !0;
|
|
38
|
+
p = a;
|
|
39
|
+
}
|
|
40
|
+
return !1;
|
|
41
|
+
}
|
|
42
|
+
function H(l, t, s, o, i) {
|
|
43
|
+
const { project: n, tears: p } = O(o, i, t), u = j.parseSync(l, {
|
|
44
|
+
// Called directly, the parser does not merge the loader's defaults: name
|
|
45
|
+
// the layer property, which a basemap selects and styles by.
|
|
46
|
+
mvt: { shape: "geojson", coordinates: "wgs84", tileIndex: t, layerProperty: "layerName", ...s.layers ? { layers: s.layers } : null }
|
|
47
|
+
}) ?? [], a = T(t.x, t.y, t.z), g = B(a, n), d = s.cut !== !1, c = s.classify, e = new Y(), r = new Y(), F = new Y(), I = new Y(), M = [], S = [], k = [];
|
|
48
|
+
u.forEach((f, h) => {
|
|
49
|
+
const w = f.properties ?? {};
|
|
50
|
+
M[h] = w;
|
|
51
|
+
const y = f.geometry?.type;
|
|
52
|
+
if (y === "Polygon" || y === "MultiPolygon") {
|
|
53
|
+
const m = c ? c.fillRank[String(w.layerName)] : 0;
|
|
54
|
+
if (m !== void 0 && S.push({ id: h, f, rank: m, casing: !1 }), s.outlines && !c) for (const v of R(f)) for (const P of v) C(F, h, w, P);
|
|
55
|
+
} else if (y === "LineString" || y === "MultiLineString") {
|
|
56
|
+
const m = c ? _(c.lineRules, w) : void 0;
|
|
57
|
+
(!c || m) && k.push({ id: h, f, rank: m?.rank ?? 0, casing: !!m?.casing });
|
|
58
|
+
} else if ((y === "Point" || y === "MultiPoint") && !c) {
|
|
59
|
+
const m = y === "Point" ? [f.geometry.coordinates] : f.geometry.coordinates;
|
|
60
|
+
for (const v of m) {
|
|
61
|
+
if (d && !g.contains(v)) continue;
|
|
62
|
+
const P = n(v[0], v[1]);
|
|
63
|
+
Number.isFinite(P[0]) && Number.isFinite(P[1]) && r.addPoint(h, w, P);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
const L = (f, h) => f.rank - h.rank;
|
|
68
|
+
c && (S.sort(L), k.sort(L));
|
|
69
|
+
for (const { id: f, f: h } of S)
|
|
70
|
+
for (const w of R(h)) {
|
|
71
|
+
const y = d ? g.polygon(w) : w;
|
|
72
|
+
y && D(e, f, h.properties ?? {}, y, n, p);
|
|
73
|
+
}
|
|
74
|
+
for (const { id: f, f: h, casing: w } of k) {
|
|
75
|
+
const y = h.geometry.type === "LineString" ? [h.geometry.coordinates] : h.geometry.coordinates;
|
|
76
|
+
for (const m of y)
|
|
77
|
+
C(r, f, h.properties ?? {}, m), w && C(I, f, h.properties ?? {}, m);
|
|
78
|
+
}
|
|
79
|
+
return { fills: e.finish(), lines: r.finish(), outlines: F.finish(), casings: I.finish(), properties: M };
|
|
80
|
+
function C(f, h, w, y) {
|
|
81
|
+
const m = d ? g.line(y) : [{ points: y, startCut: !1, endCut: !1 }];
|
|
82
|
+
for (const v of m) {
|
|
83
|
+
let P = [], z = v.startCut;
|
|
84
|
+
const A = (b) => {
|
|
85
|
+
P.length >= 2 && f.addPath(h, w, P, z, b), P = [];
|
|
86
|
+
};
|
|
87
|
+
let X = null;
|
|
88
|
+
for (const b of v.points) {
|
|
89
|
+
const x = n(b[0], b[1]);
|
|
90
|
+
if (!N(x)) {
|
|
91
|
+
A(!0), z = !0, X = null;
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
p && X && P.length && p(X, b, P[P.length - 1], x) && (A(!0), z = !0), P.push(x), X = b;
|
|
95
|
+
}
|
|
96
|
+
A(v.endCut);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
function R(l) {
|
|
101
|
+
return l.geometry.type === "Polygon" ? [l.geometry.coordinates] : l.geometry.coordinates;
|
|
102
|
+
}
|
|
103
|
+
function _(l, t) {
|
|
104
|
+
return l.find(
|
|
105
|
+
(s) => s.layer === t.layerName && (!s.classes || s.classes.includes(String(t.class))) && (!s.notMaritime || !t.maritime) && (s.adminLevelMax === void 0 || Number(t.admin_level ?? 99) <= s.adminLevelMax)
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
function D(l, t, s, o, i, n) {
|
|
109
|
+
const p = [];
|
|
110
|
+
for (const [u, a] of o.entries()) {
|
|
111
|
+
const g = [];
|
|
112
|
+
for (const [d, c] of a.entries()) {
|
|
113
|
+
const e = i(c[0], c[1]);
|
|
114
|
+
if (!N(e)) break;
|
|
115
|
+
if (n && d > 0 && n(a[d - 1], c, g[d - 1], e)) return;
|
|
116
|
+
g.push(e);
|
|
117
|
+
}
|
|
118
|
+
if (g.length === a.length && g.length >= 4) p.push(g);
|
|
119
|
+
else if (u === 0) return;
|
|
120
|
+
}
|
|
121
|
+
p.length && l.addPolygon(t, s, p);
|
|
122
|
+
}
|
|
123
|
+
class Y {
|
|
124
|
+
pointXY = [];
|
|
125
|
+
pointIds = [];
|
|
126
|
+
pointProps = [];
|
|
127
|
+
pointFeature = [];
|
|
128
|
+
lineXY = [];
|
|
129
|
+
lineIds = [];
|
|
130
|
+
lineFeature = [];
|
|
131
|
+
lineCut = [];
|
|
132
|
+
pathStarts = [0];
|
|
133
|
+
lineProps = [];
|
|
134
|
+
polyXY = [];
|
|
135
|
+
polyIds = [];
|
|
136
|
+
polyFeature = [];
|
|
137
|
+
polygonStarts = [0];
|
|
138
|
+
ringStarts = [0];
|
|
139
|
+
triangles = [];
|
|
140
|
+
polyProps = [];
|
|
141
|
+
/** Properties are indexed per geometry type; a feature's index is reused across its pieces. */
|
|
142
|
+
propIndex = [/* @__PURE__ */ new Map(), /* @__PURE__ */ new Map(), /* @__PURE__ */ new Map()];
|
|
143
|
+
propsFor(t, s, o, i) {
|
|
144
|
+
let n = this.propIndex[t].get(s);
|
|
145
|
+
return n === void 0 && (n = i.length, i.push(o), this.propIndex[t].set(s, n)), n;
|
|
146
|
+
}
|
|
147
|
+
addPoint(t, s, o) {
|
|
148
|
+
const i = this.propsFor(0, t, s, this.pointProps);
|
|
149
|
+
this.pointXY.push(o[0], o[1]), this.pointIds.push(t), this.pointFeature.push(i);
|
|
150
|
+
}
|
|
151
|
+
addPath(t, s, o, i, n) {
|
|
152
|
+
const p = this.propsFor(1, t, s, this.lineProps), u = (i ? 1 : 0) + (n ? 2 : 0);
|
|
153
|
+
for (const a of o)
|
|
154
|
+
this.lineXY.push(a[0], a[1]), this.lineIds.push(t), this.lineFeature.push(p), this.lineCut.push(u);
|
|
155
|
+
this.pathStarts.push(this.lineXY.length / 2);
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* A polygon, triangulated in the PLANE: its fill then follows its projected
|
|
159
|
+
* outline. Triangulated in lng/lat instead, a triangle's straight edges in
|
|
160
|
+
* the plane are chords of curves — thousands of kilometres off where the
|
|
161
|
+
* projection is far from linear (an ocean fill 80° from BNG's meridian
|
|
162
|
+
* covered Canada). The slivers that triangulating in the plane makes along a
|
|
163
|
+
* nearly straight tile edge are avoided where they are made: the cutter
|
|
164
|
+
* leaves such an edge its ends alone (tile-cut.ts, `bowedEdges`).
|
|
165
|
+
*/
|
|
166
|
+
addPolygon(t, s, o) {
|
|
167
|
+
const i = this.propsFor(2, t, s, this.polyProps), n = this.polyXY.length / 2, p = [], u = [], [a, g] = o[0][0];
|
|
168
|
+
for (const [d, c] of o.entries()) {
|
|
169
|
+
d > 0 && u.push(p.length / 2);
|
|
170
|
+
for (const e of c)
|
|
171
|
+
this.polyXY.push(e[0], e[1]), p.push(e[0] - a, e[1] - g), this.polyIds.push(t), this.polyFeature.push(i);
|
|
172
|
+
this.ringStarts.push(this.polyXY.length / 2);
|
|
173
|
+
}
|
|
174
|
+
for (const d of E(p, u, 2)) this.triangles.push(n + d);
|
|
175
|
+
this.polygonStarts.push(this.polyXY.length / 2);
|
|
176
|
+
}
|
|
177
|
+
finish() {
|
|
178
|
+
const t = (s, o, i, n) => ({
|
|
179
|
+
positions: { value: new Float64Array(s), size: 2 },
|
|
180
|
+
globalFeatureIds: { value: new Uint32Array(o), size: 1 },
|
|
181
|
+
featureIds: { value: new Uint32Array(i), size: 1 },
|
|
182
|
+
numericProps: {},
|
|
183
|
+
properties: n,
|
|
184
|
+
fields: []
|
|
185
|
+
});
|
|
186
|
+
return {
|
|
187
|
+
shape: "binary-feature-collection",
|
|
188
|
+
points: { type: "Point", ...t(this.pointXY, this.pointIds, this.pointFeature, this.pointProps) },
|
|
189
|
+
lines: {
|
|
190
|
+
type: "LineString",
|
|
191
|
+
...t(this.lineXY, this.lineIds, this.lineFeature, this.lineProps),
|
|
192
|
+
pathIndices: { value: new Uint32Array(this.pathStarts), size: 1 },
|
|
193
|
+
attributes: { getCutEnds: { value: new Float32Array(this.lineCut), size: 1 } }
|
|
194
|
+
},
|
|
195
|
+
polygons: {
|
|
196
|
+
type: "Polygon",
|
|
197
|
+
...t(this.polyXY, this.polyIds, this.polyFeature, this.polyProps),
|
|
198
|
+
polygonIndices: { value: new Uint32Array(this.polygonStarts), size: 1 },
|
|
199
|
+
primitivePolygonIndices: { value: new Uint32Array(this.ringStarts), size: 1 },
|
|
200
|
+
triangles: { value: new Uint32Array(this.triangles), size: 1 }
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
export {
|
|
206
|
+
H as buildPlaneTile,
|
|
207
|
+
O as tileProjection
|
|
208
|
+
};
|
package/dist/cartograph.js
CHANGED
|
@@ -240,11 +240,11 @@ async function Nr(r) {
|
|
|
240
240
|
})
|
|
241
241
|
), t;
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function ze(r) {
|
|
244
244
|
return !r.hasAttribute("hidden") && !r.hasAttribute("data-om-carto-screen-only") && !r.hasAttribute("data-om-carto-marks") && !r.hasAttribute("data-om-carto-flattened") && r.tagName.toLowerCase() !== "style" && r.tagName.toLowerCase() !== "script";
|
|
245
245
|
}
|
|
246
246
|
function Pr(r) {
|
|
247
|
-
return [...r.children].filter(
|
|
247
|
+
return [...r.children].filter(ze).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);
|
|
248
248
|
}
|
|
249
249
|
async function Wt(r, t = {}) {
|
|
250
250
|
const e = r ?? document.querySelector("om-cartograph");
|
|
@@ -302,7 +302,7 @@ async function Wt(r, t = {}) {
|
|
|
302
302
|
if (!N) throw new Error("[onlymapjs/cartograph] renderCartograph: the canvas produced no image (it may have exceeded a browser limit).");
|
|
303
303
|
return { blob: N, widthPx: b, heightPx: w, dpi: d, warnings: n };
|
|
304
304
|
}
|
|
305
|
-
async function
|
|
305
|
+
async function je(r, t = {}) {
|
|
306
306
|
const e = r ?? document.querySelector("om-cartograph");
|
|
307
307
|
if (!e) throw new Error("[onlymapjs/cartograph] renderCartographAtlas: no <om-cartograph> to render.");
|
|
308
308
|
const n = e.querySelector("om-atlas") ?? null;
|
|
@@ -343,9 +343,9 @@ const Tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
343
343
|
__proto__: null,
|
|
344
344
|
MAX_CANVAS_AREA: De,
|
|
345
345
|
MAX_CANVAS_DIMENSION: Ue,
|
|
346
|
-
paintsInExport:
|
|
346
|
+
paintsInExport: ze,
|
|
347
347
|
renderCartograph: Wt,
|
|
348
|
-
renderCartographAtlas:
|
|
348
|
+
renderCartographAtlas: je
|
|
349
349
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
350
350
|
function re(r, t, e = {}) {
|
|
351
351
|
const n = URL.createObjectURL(r), i = document.createElement("a");
|
|
@@ -390,7 +390,7 @@ async function Rr(r, t = {}) {
|
|
|
390
390
|
const d = Number(c);
|
|
391
391
|
if (!Number.isInteger(d) || d < 1) throw new Error(`?page=${c} is not a page number (they start at 1).`);
|
|
392
392
|
h.refresh?.();
|
|
393
|
-
const m = await
|
|
393
|
+
const m = await je(r, { dpi: a, format: o, page: d - 1 });
|
|
394
394
|
for (const f of m.warnings) console.warn(`[onlymapjs/cartograph] ${f}`);
|
|
395
395
|
return re(m.blob, m.filenames[0] ?? `${l}.${o === "jpeg" ? "jpg" : "png"}`, { revokeAfterMs: 1e4 }), "export";
|
|
396
396
|
}
|
|
@@ -494,21 +494,21 @@ class O extends qe {
|
|
|
494
494
|
}
|
|
495
495
|
const bt = "cartograph/2", Ii = ["default", "dark", "sepia", "blueprint", "minimal"], se = ["A0", "A1", "A2", "A3", "A4", "A5", "Letter", "Legal"], Ur = /* @__PURE__ */ new Map([
|
|
496
496
|
["projection", "live frames render Web Mercator (EPSG:3857) only — Globe support is design-only; use a static frame for other projections"]
|
|
497
|
-
]),
|
|
497
|
+
]), z = ["id", "x", "y", "w", "h", "rotation", "z", "locked", "hidden"], T = {
|
|
498
498
|
"om-cartograph": ["cartograph-id", "format", "size", "width", "height", "orientation", "theme", "bg", "color", "font", "title", "attribution", "notes", "cvd", "bleed", "crop-marks", "safe-zone", "dpi", "flatten", "color-profile", "allow-url-actions", "keep-badge"],
|
|
499
|
-
"om-frame": [...
|
|
500
|
-
"om-legend": [...
|
|
499
|
+
"om-frame": [...z, "src", "mode", "center", "zoom", "bearing", "pitch", "dpi", "crs", "corners", "crs-def", "overview-of", "overview-stroke", "atlas-fit", "atlas-margin", "frame-stroke", "frame-bg", "attribution"],
|
|
500
|
+
"om-legend": [...z, "for", "title", "columns", "derived", "bg", "color", "stroke", "font-size", "padding"],
|
|
501
501
|
"om-legend-row": ["layer", "match", "label", "hide", "order", "color", "shape"],
|
|
502
502
|
// NOTE: the discriminator on furniture is `kind`, never `style` — `style` is
|
|
503
503
|
// the global HTML attribute the runtime itself writes for mm placement, so
|
|
504
504
|
// `style="double"` would be erased on the first render. `kind` also matches
|
|
505
505
|
// om-text/om-shape, so the whole vocabulary has ONE discriminator word.
|
|
506
|
-
"om-scalebar": [...
|
|
507
|
-
"om-north": [...
|
|
508
|
-
"om-graticule": [...
|
|
509
|
-
"om-text": [...
|
|
510
|
-
"om-shape": [...
|
|
511
|
-
"om-image": [...
|
|
506
|
+
"om-scalebar": [...z, "for", "units", "segments", "segment-length", "kind", "color"],
|
|
507
|
+
"om-north": [...z, "for", "kind", "color"],
|
|
508
|
+
"om-graticule": [...z, "for", "crs", "crs-def", "interval", "interval-x", "interval-y", "kind", "labels", "format", "color"],
|
|
509
|
+
"om-text": [...z, "kind", "font-size", "weight", "align", "font", "color", "bg"],
|
|
510
|
+
"om-shape": [...z, "kind", "fill", "fill-opacity", "stroke", "stroke-width", "radius"],
|
|
511
|
+
"om-image": [...z, "src", "fit"],
|
|
512
512
|
// NOT placed: a source is a child of <om-frame> that says where the frame's
|
|
513
513
|
// picture may come from. Its corners/crs describe THAT source — a capture
|
|
514
514
|
// carries the georeference that was true when it was taken, which is the
|
|
@@ -516,7 +516,7 @@ const bt = "cartograph/2", Ii = ["default", "dark", "sepia", "blueprint", "minim
|
|
|
516
516
|
// CRS is therefore unknowable.
|
|
517
517
|
"om-source": ["src", "corners", "crs", "crs-def", "attribution"],
|
|
518
518
|
"om-atlas": ["id", "for", "layer", "filter", "sort", "filename", "page-name", "pager"]
|
|
519
|
-
}, yt = Object.keys(T), Lt = "data-om-carto-vector", Dr = ["metric", "imperial", "nautical"],
|
|
519
|
+
}, yt = Object.keys(T), Lt = "data-om-carto-vector", Dr = ["metric", "imperial", "nautical"], zr = 0.3048, jr = 1609.344, Gr = 1852;
|
|
520
520
|
function qr(r) {
|
|
521
521
|
return r != null && Dr.includes(r) ? r : null;
|
|
522
522
|
}
|
|
@@ -532,8 +532,8 @@ const oe = {
|
|
|
532
532
|
{ metersPerUnit: 1e3, label: "km" }
|
|
533
533
|
],
|
|
534
534
|
imperial: [
|
|
535
|
-
{ metersPerUnit:
|
|
536
|
-
{ metersPerUnit:
|
|
535
|
+
{ metersPerUnit: zr, label: "ft" },
|
|
536
|
+
{ metersPerUnit: jr, label: "mi" }
|
|
537
537
|
],
|
|
538
538
|
nautical: [{ metersPerUnit: Gr, label: "nmi" }]
|
|
539
539
|
};
|
|
@@ -1156,7 +1156,9 @@ async function bn(r, t) {
|
|
|
1156
1156
|
units: o,
|
|
1157
1157
|
metresPerUnit: a,
|
|
1158
1158
|
forward: (l) => i.inverse(l),
|
|
1159
|
-
inverse: (l) => i.forward(l)
|
|
1159
|
+
inverse: (l) => i.forward(l),
|
|
1160
|
+
...typeof t == "string" && /^\s*\+proj=/.test(t) ? { definition: t.trim() } : null,
|
|
1161
|
+
proj4Source: t
|
|
1160
1162
|
};
|
|
1161
1163
|
}
|
|
1162
1164
|
const be = Math.PI / 180, yn = 180 / Math.PI, wn = { code: "EPSG:3857", forward: Kt, inverse: pt }, Oi = Kt, _i = pt, ye = 6378137, we = 89.9;
|
|
@@ -1387,7 +1389,7 @@ function mt(r) {
|
|
|
1387
1389
|
pitch: Number(r.getAttribute("pitch")) || 0
|
|
1388
1390
|
};
|
|
1389
1391
|
}
|
|
1390
|
-
function
|
|
1392
|
+
function zi(r, t, e, n, i = 60) {
|
|
1391
1393
|
const s = (l) => _t(r, { ...t, pitch: l }, e, n) !== null;
|
|
1392
1394
|
if (s(i)) return i;
|
|
1393
1395
|
if (!s(0)) return 0;
|
|
@@ -2240,12 +2242,12 @@ class ar extends O {
|
|
|
2240
2242
|
}
|
|
2241
2243
|
}
|
|
2242
2244
|
x("om-shape", ar);
|
|
2243
|
-
const xe = "data-om-carto-owned",
|
|
2245
|
+
const xe = "data-om-carto-owned", zn = ["contain", "cover", "fill"];
|
|
2244
2246
|
class lr extends O {
|
|
2245
2247
|
static observedAttributes = [...T["om-image"]];
|
|
2246
2248
|
get fit() {
|
|
2247
2249
|
const t = this.getAttribute("fit");
|
|
2248
|
-
return
|
|
2250
|
+
return zn.includes(t ?? "") ? t : "contain";
|
|
2249
2251
|
}
|
|
2250
2252
|
get image() {
|
|
2251
2253
|
return this.querySelector(":scope > img");
|
|
@@ -2271,11 +2273,11 @@ class lr extends O {
|
|
|
2271
2273
|
}
|
|
2272
2274
|
}
|
|
2273
2275
|
x("om-image", lr);
|
|
2274
|
-
const
|
|
2276
|
+
const jn = /* @__PURE__ */ new Set(["PathLayer", "LineLayer", "ArcLayer", "TripsLayer", "GreatCircleLayer", "PathStyleLayer"]), Gn = /* @__PURE__ */ new Set(["ScatterplotLayer", "IconLayer", "TextLayer", "PointCloudLayer", "HeatmapLayer", "ScreenGridLayer"]), qn = /* @__PURE__ */ new Set(["COGLayer", "ZarrLayer", "BitmapLayer", "TerrainLayer", "ImageOverlay"]);
|
|
2275
2277
|
function Wn(r) {
|
|
2276
2278
|
const t = r.type ?? "";
|
|
2277
2279
|
if (qn.has(t)) return "ramp";
|
|
2278
|
-
if (
|
|
2280
|
+
if (jn.has(t)) return "line";
|
|
2279
2281
|
if (Gn.has(t)) return "point";
|
|
2280
2282
|
if (t === "GeoJsonLayer") {
|
|
2281
2283
|
const e = r.props ?? {}, n = e.getFillColor !== void 0, i = e.getLineColor !== void 0;
|
|
@@ -2552,7 +2554,7 @@ function Qn(r, t) {
|
|
|
2552
2554
|
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, h = a === 60 ? 0 : a;
|
|
2553
2555
|
return `${c}°${String(u).padStart(2, "0")}′${String(h).padStart(2, "0")}″${e}`;
|
|
2554
2556
|
}
|
|
2555
|
-
const ut = "http://www.w3.org/2000/svg", ti = ["solid", "cross", "markers"],
|
|
2557
|
+
const ut = "http://www.w3.org/2000/svg", ti = ["solid", "cross", "markers"], j = 1.4;
|
|
2556
2558
|
class hr extends O {
|
|
2557
2559
|
static observedAttributes = [...T["om-graticule"]];
|
|
2558
2560
|
resolvedPlane = null;
|
|
@@ -2631,7 +2633,7 @@ class hr extends O {
|
|
|
2631
2633
|
} else
|
|
2632
2634
|
for (const c of this.tickPoints(l, a, t)) {
|
|
2633
2635
|
const u = i.createElementNS(ut, "path");
|
|
2634
|
-
u.setAttribute("d", `M ${c.xMm -
|
|
2636
|
+
u.setAttribute("d", `M ${c.xMm - j} ${c.yMm} H ${c.xMm + j} M ${c.xMm} ${c.yMm - j} V ${c.yMm + j}`), u.setAttribute("stroke", o), u.setAttribute("stroke-width", "0.15"), s.appendChild(u);
|
|
2635
2637
|
}
|
|
2636
2638
|
for (const l of t.labels) {
|
|
2637
2639
|
const c = i.createElementNS(ut, "text");
|
|
@@ -2659,7 +2661,7 @@ class hr extends O {
|
|
|
2659
2661
|
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();
|
|
2660
2662
|
else
|
|
2661
2663
|
for (const c of this.tickPoints(l, a, n))
|
|
2662
|
-
t.beginPath(), t.moveTo(o(c.xMm -
|
|
2664
|
+
t.beginPath(), t.moveTo(o(c.xMm - j), o(c.yMm)), t.lineTo(o(c.xMm + j), o(c.yMm)), t.moveTo(o(c.xMm), o(c.yMm - j)), t.lineTo(o(c.xMm), o(c.yMm + j)), t.stroke();
|
|
2663
2665
|
t.font = `${o(2.2)}px ${i?.fontFamily || "system-ui, sans-serif"}`, t.textBaseline = "alphabetic";
|
|
2664
2666
|
for (const l of n.labels)
|
|
2665
2667
|
t.textAlign = l.edge === "left" ? "right" : "center", t.fillText(l.text, o(l.xMm), o(l.yMm));
|
|
@@ -2681,13 +2683,13 @@ function ri(r, t) {
|
|
|
2681
2683
|
const e = r.properties;
|
|
2682
2684
|
return e && t in e ? e[t] : r[t];
|
|
2683
2685
|
}
|
|
2684
|
-
function
|
|
2686
|
+
function zt(r, t) {
|
|
2685
2687
|
if (Array.isArray(r)) {
|
|
2686
2688
|
if (typeof r[0] == "number") {
|
|
2687
2689
|
t.push([r[0], r[1]]);
|
|
2688
2690
|
return;
|
|
2689
2691
|
}
|
|
2690
|
-
for (const e of r)
|
|
2692
|
+
for (const e of r) zt(e, t);
|
|
2691
2693
|
}
|
|
2692
2694
|
}
|
|
2693
2695
|
function ni(r) {
|
|
@@ -2696,7 +2698,7 @@ function ni(r) {
|
|
|
2696
2698
|
function F(r, t) {
|
|
2697
2699
|
return ri(r, t);
|
|
2698
2700
|
}
|
|
2699
|
-
function
|
|
2701
|
+
function jt(r) {
|
|
2700
2702
|
const t = {}, e = (i) => {
|
|
2701
2703
|
for (const [s, o] of Object.entries(i))
|
|
2702
2704
|
o == null || typeof o == "object" || (t[s] = String(o));
|
|
@@ -2708,8 +2710,8 @@ function zt(r) {
|
|
|
2708
2710
|
function ii(r) {
|
|
2709
2711
|
let t = 1 / 0, e = 1 / 0, n = -1 / 0, i = -1 / 0;
|
|
2710
2712
|
const s = [], o = r.geometry;
|
|
2711
|
-
if (o?.coordinates != null)
|
|
2712
|
-
else if (Array.isArray(r.coordinates))
|
|
2713
|
+
if (o?.coordinates != null) zt(o.coordinates, s);
|
|
2714
|
+
else if (Array.isArray(r.coordinates)) zt(r.coordinates, s);
|
|
2713
2715
|
else {
|
|
2714
2716
|
const a = Number(F(r, "lng") ?? F(r, "longitude") ?? F(r, "lon") ?? F(r, "x")), l = Number(F(r, "lat") ?? F(r, "latitude") ?? F(r, "y"));
|
|
2715
2717
|
Number.isFinite(a) && Number.isFinite(l) && s.push([a, l]);
|
|
@@ -2722,7 +2724,7 @@ function si(r, t) {
|
|
|
2722
2724
|
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;
|
|
2723
2725
|
return [e - l, n - c, i + l, s + c];
|
|
2724
2726
|
}
|
|
2725
|
-
const
|
|
2727
|
+
const ji = ([r, t, e, n]) => Math.max(0, e - r) * Math.max(0, n - t);
|
|
2726
2728
|
function oi({ features: r, filter: t, sort: e }) {
|
|
2727
2729
|
let n = t ? r.filter((s) => ai(t, s)) : [...r];
|
|
2728
2730
|
const i = li(e);
|
|
@@ -2758,7 +2760,7 @@ function ui(r) {
|
|
|
2758
2760
|
function hi(r, t, e) {
|
|
2759
2761
|
const n = /* @__PURE__ */ new Map();
|
|
2760
2762
|
return t.map((i, s) => {
|
|
2761
|
-
const o =
|
|
2763
|
+
const o = jt(i), a = (r ?? "page-{{atlas.index}}").replace(/\{\{\s*atlas\.([\w]+)\s*\}\}/g, (u, h) => h === "index" ? String(s + 1) : h === "count" ? String(t.length) : o[h] ?? u), l = ui(a), c = n.get(l) ?? 0;
|
|
2762
2764
|
return n.set(l, c + 1), `${c === 0 ? l : `${l}-${c + 1}`}.${e}`;
|
|
2763
2765
|
});
|
|
2764
2766
|
}
|
|
@@ -2840,7 +2842,7 @@ class mr extends O {
|
|
|
2840
2842
|
pageName(t) {
|
|
2841
2843
|
const e = this.ensurePages()[t];
|
|
2842
2844
|
if (!e) return `Page ${t + 1}`;
|
|
2843
|
-
const n =
|
|
2845
|
+
const n = jt(e), i = this.getAttribute("page-name");
|
|
2844
2846
|
return i ? i.replace(
|
|
2845
2847
|
/\{\{\s*atlas\.([\w]+)\s*\}\}/g,
|
|
2846
2848
|
(s, o) => o === "index" ? String(t + 1) : o === "count" ? String(this.count) : n[o] ?? s
|
|
@@ -2918,7 +2920,7 @@ class mr extends O {
|
|
|
2918
2920
|
const a = Number(s.getAttribute("atlas-margin")), l = si(o, Number.isFinite(a) && a > 0 ? a : 0.15);
|
|
2919
2921
|
s.fitBounds?.(l);
|
|
2920
2922
|
}
|
|
2921
|
-
e?.setAtlasFields({ ...
|
|
2923
|
+
e?.setAtlasFields({ ...jt(t), index: String(this.currentIndex + 1), count: String(this.count) }), e?.refreshFurniture();
|
|
2922
2924
|
const n = this.pageName(this.currentIndex);
|
|
2923
2925
|
this.dispatchEvent(
|
|
2924
2926
|
new CustomEvent("om-atlas-page", {
|
|
@@ -3395,7 +3397,7 @@ export {
|
|
|
3395
3397
|
tr as OmTextElement,
|
|
3396
3398
|
Xt as PAGE_PRESETS,
|
|
3397
3399
|
se as PAGE_SIZE_NAMES,
|
|
3398
|
-
|
|
3400
|
+
z as PLACED_ATTR_NAMES,
|
|
3399
3401
|
D as PX_PER_MM,
|
|
3400
3402
|
Br as SCALE_GROUP_SEPARATOR,
|
|
3401
3403
|
Lr as URL_ACTION_TIMEOUT_MS,
|
|
@@ -3404,8 +3406,8 @@ export {
|
|
|
3404
3406
|
$r as applyCvdToCanvas,
|
|
3405
3407
|
Yr as applyTokens,
|
|
3406
3408
|
Rr as applyUrlActions,
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
+
jt as atlasFields,
|
|
3410
|
+
ji as boundsArea,
|
|
3409
3411
|
S as boxMm,
|
|
3410
3412
|
Xn as buildGraticule,
|
|
3411
3413
|
oi as buildPages,
|
|
@@ -3433,7 +3435,7 @@ export {
|
|
|
3433
3435
|
en as layoutText,
|
|
3434
3436
|
kr as lintLegendColours,
|
|
3435
3437
|
Fe as loadCore,
|
|
3436
|
-
|
|
3438
|
+
zi as maxGeoreferenceablePitch,
|
|
3437
3439
|
Oi as mercatorForward,
|
|
3438
3440
|
_i as mercatorInverse,
|
|
3439
3441
|
Ee as niceInterval,
|
|
@@ -3453,7 +3455,7 @@ export {
|
|
|
3453
3455
|
U as referencedFrame,
|
|
3454
3456
|
ni as rejectionFor,
|
|
3455
3457
|
Wt as renderCartograph,
|
|
3456
|
-
|
|
3458
|
+
je as renderCartographAtlas,
|
|
3457
3459
|
Ot as resolveCrsForward,
|
|
3458
3460
|
Gt as resolveCvdType,
|
|
3459
3461
|
hi as resolveFilenames,
|
|
@@ -1156,7 +1156,9 @@ async function ia(t, e) {
|
|
|
1156
1156
|
units: a,
|
|
1157
1157
|
metresPerUnit: o,
|
|
1158
1158
|
forward: (h) => r.inverse(h),
|
|
1159
|
-
inverse: (h) => r.forward(h)
|
|
1159
|
+
inverse: (h) => r.forward(h),
|
|
1160
|
+
...typeof e == "string" && /^\s*\+proj=/.test(e) ? { definition: e.trim() } : null,
|
|
1161
|
+
proj4Source: e
|
|
1160
1162
|
};
|
|
1161
1163
|
}
|
|
1162
1164
|
const rs = Math.PI / 180, sa = 180 / Math.PI, ra = { code: "EPSG:3857", forward: wi, inverse: Te }, Ru = wi, Tu = Te, ns = 6378137, as = 89.9;
|