@nika-js/onlymap 0.11.11 → 0.12.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.
Files changed (55) hide show
  1. package/README.md +9 -3
  2. package/dist/attribute-resolution.d.ts +2 -0
  3. package/dist/{basemap-QT4ua-dL.js → basemap-CtDse0mW.js} +1514 -1462
  4. package/dist/basemap.d.ts +41 -1
  5. package/dist/cartograph.js +362 -321
  6. package/dist/cartograph.standalone.js +1995 -1914
  7. package/dist/{cityjson-k-z1r6c0.js → cityjson-DMc_dwu1.js} +1 -1
  8. package/dist/{crs-BzE_KP4M.js → crs-D5FyQfEu.js} +74 -7
  9. package/dist/{crs-ChglCB3O.js → crs-ZdDBJ2EY.js} +39 -36
  10. package/dist/data-layer.d.ts +36 -3
  11. package/dist/elements/om-map.d.ts +2 -1
  12. package/dist/geoparquet-BTHYX1ET.js +30 -0
  13. package/dist/geoparquet.d.ts +6 -7
  14. package/dist/{globe-view-BSGTUqWc.js → globe-view-KrKNOmVs.js} +11 -11
  15. package/dist/hillshade-CijRdYyU.js +209 -0
  16. package/dist/html-data.d.ts +1 -1
  17. package/dist/{ifc-DXwePQRv.js → ifc-sisRo7I7.js} +1 -1
  18. package/dist/{index-Bxue4Psc.js → index-21KGElDr.js} +9 -9
  19. package/dist/{index-DjYxw-8H.js → index-A45DtXly.js} +18 -18
  20. package/dist/{index-Dwc4s3mc.js → index-BPa2CC8T.js} +20 -20
  21. package/dist/{index-DudIuhJa.js → index-B_Vhebf7.js} +1 -1
  22. package/dist/{index-DBt_2x-w.js → index-Bfocr1_A.js} +106 -106
  23. package/dist/{index-CevWTqBO.js → index-DMc81n9B.js} +14362 -13782
  24. package/dist/{index-D1ZjhP2H.js → index-DS6VUGi6.js} +11 -11
  25. package/dist/{index-BO7MtTkn.js → index-DoGY-Vgi.js} +3 -3
  26. package/dist/{index-Bzypgr1v.js → index-eHYe06mM.js} +1 -1
  27. package/dist/index.d.ts +3 -2
  28. package/dist/ir.d.ts +6 -0
  29. package/dist/layer-registry.d.ts +21 -0
  30. package/dist/layers/warped-bitmap-layer.d.ts +27 -0
  31. package/dist/{lerc-DQuf93SN.js → lerc-DjrPALEj.js} +1 -1
  32. package/dist/onlymap.standalone.js +53019 -52455
  33. package/dist/onlymapjs.js +86 -84
  34. package/dist/parse-manifest.d.ts +12 -9
  35. package/dist/{post-process-effect-B3j_nBzy.js → post-process-effect-Be1qa2DD.js} +5 -5
  36. package/dist/programmatic.d.ts +12 -0
  37. package/dist/projection.d.ts +44 -1
  38. package/dist/{raster-pipeline-CusoihQ3.js → raster-pipeline-DspBYxwc.js} +1 -1
  39. package/dist/{raster-CvAJ-h_g.js → raster-zC3qXBrs.js} +3 -3
  40. package/dist/react/om-layer.d.ts +4 -0
  41. package/dist/react/om-map.d.ts +2 -0
  42. package/dist/react.js +225 -218
  43. package/dist/runtime-core.d.ts +24 -0
  44. package/dist/source-crs.d.ts +99 -0
  45. package/dist/{text-on-path-D9u5SYCo.js → text-on-path-D0_URrD2.js} +1 -1
  46. package/dist/{zarr-DWb_nikR.js → zarr-DopOhzfY.js} +2 -2
  47. package/docs/cartography.md +106 -1
  48. package/llms.txt +2 -1
  49. package/onlymapjs.attributes.json +2 -0
  50. package/onlymapjs.html-data.json +26 -4
  51. package/package.json +1 -1
  52. package/skills/onlymapjs/SKILL.md +4 -2
  53. package/skills/onlymapjs/references/syntax.md +16 -1
  54. package/dist/geoparquet-hOsdfZJa.js +0 -35
  55. package/dist/hillshade-D2Ps3Nim.js +0 -298
@@ -1,4 +1,4 @@
1
- import { CRS_DEFS as F, COMPOUND_TO_HORIZONTAL as q } from "./crs-ChglCB3O.js";
1
+ import { COMPOUND_TO_HORIZONTAL as q, CRS_DEFS as F } from "./crs-D5FyQfEu.js";
2
2
  const j = 0.5;
3
3
  function G(e, t) {
4
4
  if (!Array.isArray(e)) return [];
@@ -1,4 +1,13 @@
1
- const s = [
1
+ const m = {
2
+ 7415: 28992,
3
+ // Amersfoort / RD New + NAP height — the 3DBAG default
4
+ 6697: 6668,
5
+ // JGD2011 geographic 3D + height — the PLATEAU default
6
+ 5555: 25832,
7
+ // ETRS89 / UTM 32N + DHHN92 height
8
+ 5556: 25833
9
+ // ETRS89 / UTM 33N + DHHN92 height
10
+ }, f = [
2
11
  [33, 129.5],
3
12
  [33, 131],
4
13
  [36, 132.166666666667],
@@ -18,7 +27,7 @@ const s = [
18
27
  [26, 131],
19
28
  [20, 136],
20
29
  [26, 154]
21
- ], l = {
30
+ ], d = {
22
31
  // Netherlands — Amersfoort / RD New (3DBAG).
23
32
  28992: {
24
33
  def: "+proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.4171,50.3319,465.5524,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs"
@@ -76,19 +85,77 @@ const s = [
76
85
  2154: {
77
86
  def: "+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs"
78
87
  },
88
+ // National grids a data file is likely to name (docs/design/crs.md, D5:
89
+ // bundle generously so the online lookup almost never fires). Definitions
90
+ // are epsg.io's own `.proj4` text, fetched 2026-10-06 and checked against
91
+ // PROJ 9.8 in projection.test.ts — not hand-derived.
92
+ 2193: { def: "+proj=tmerc +lat_0=0 +lon_0=173 +k=0.9996 +x_0=1600000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
93
+ // NZGD2000 / NZTM 2000
94
+ 3006: { def: "+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
95
+ // SWEREF99 TM (Sweden)
96
+ 3035: { def: "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
97
+ // ETRS89-extended / LAEA Europe
98
+ 3577: { def: "+proj=aea +lat_0=0 +lon_0=132 +lat_1=-18 +lat_2=-36 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
99
+ // GDA94 / Australian Albers
100
+ 2326: { def: "+proj=tmerc +lat_0=22.3121333333333 +lon_0=114.178555555556 +k=1 +x_0=836694.05 +y_0=819069.8 +ellps=intl +towgs84=-162.619,-276.959,-161.764,-0.067753,2.243648,1.158828,-1.094246 +units=m +no_defs" },
101
+ // Hong Kong 1980 Grid
102
+ 5179: { def: "+proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
103
+ // Korea 2000 / Unified CS
104
+ 3826: { def: "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
105
+ // TWD97 / TM2 zone 121 (Taiwan)
106
+ // Geographic datums on GRS80 — longitude/latitude already, within a metre or
107
+ // two of WGS84; named so a file declaring one resolves offline.
108
+ 4269: { def: "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs", geographic: !0 },
109
+ // NAD83
110
+ 4258: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0 },
111
+ // ETRS89
112
+ 4283: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0 },
113
+ // GDA94
114
+ 7844: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0 },
115
+ // GDA2020
116
+ 4167: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0 },
117
+ // NZGD2000
79
118
  // Japan — JGD2011 geographic 2D. EPSG axis order is (lat, lon).
80
119
  6668: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0, swapXY: !0 },
81
120
  // WGS 84. Files in the wild store lon/lat despite EPSG's formal (lat, lon).
82
121
  4326: { def: "+proj=longlat +datum=WGS84 +no_defs", geographic: !0 },
83
122
  3857: { def: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +no_defs" }
84
123
  };
85
- for (let e = 0; e < s.length; e++) {
86
- const [_, o] = s[e];
87
- l[6669 + e] = {
88
- def: `+proj=tmerc +lat_0=${_} +lon_0=${o} +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs`,
124
+ for (let e = 0; e < f.length; e++) {
125
+ const [t, n] = f[e];
126
+ d[6669 + e] = {
127
+ def: `+proj=tmerc +lat_0=${t} +lon_0=${n} +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs`,
89
128
  swapXY: !0
90
129
  };
91
130
  }
131
+ let u = null;
132
+ async function c() {
133
+ return (await import("./index-CW1n5LdO.js")).default;
134
+ }
135
+ function g() {
136
+ return u ??= c(), u;
137
+ }
138
+ function j() {
139
+ return Object.keys(d).map(Number).sort((e, t) => e - t);
140
+ }
141
+ async function i(e, t, n) {
142
+ const r = m[e] ?? e, o = d[r];
143
+ if (!o) return null;
144
+ const [l, s] = o.swapXY ? [n, t] : [t, n];
145
+ if (o.geographic) return [l, s];
146
+ const a = await g(), [_, p] = a(o.def, "+proj=longlat +datum=WGS84 +no_defs").forward([l, s]);
147
+ return Number.isFinite(_) && Number.isFinite(p) ? [_, p] : null;
148
+ }
149
+ async function S(e, t, n, r = 100) {
150
+ const o = await i(e, t, n), l = await i(e, t, n + r);
151
+ if (!o || !l) return null;
152
+ const s = (o[1] + l[1]) / 2 * Math.PI / 180, a = (l[0] - o[0]) * Math.cos(s), _ = l[1] - o[1];
153
+ return Math.atan2(a, _) * 180 / Math.PI;
154
+ }
92
155
  export {
93
- l as CRS_DEFS
156
+ m as COMPOUND_TO_HORIZONTAL,
157
+ d as CRS_DEFS,
158
+ j as bundledCrsCodes,
159
+ S as gridConvergence,
160
+ i as projectedToLonLat
94
161
  };
@@ -1,4 +1,4 @@
1
- const m = {
1
+ const t = {
2
2
  7415: 28992,
3
3
  // Amersfoort / RD New + NAP height — the 3DBAG default
4
4
  6697: 6668,
@@ -7,7 +7,7 @@ const m = {
7
7
  // ETRS89 / UTM 32N + DHHN92 height
8
8
  5556: 25833
9
9
  // ETRS89 / UTM 33N + DHHN92 height
10
- }, f = [
10
+ }, o = [
11
11
  [33, 129.5],
12
12
  [33, 131],
13
13
  [36, 132.166666666667],
@@ -27,7 +27,7 @@ const m = {
27
27
  [26, 131],
28
28
  [20, 136],
29
29
  [26, 154]
30
- ], u = {
30
+ ], _ = {
31
31
  // Netherlands — Amersfoort / RD New (3DBAG).
32
32
  28992: {
33
33
  def: "+proj=sterea +lat_0=52.1561605555556 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.4171,50.3319,465.5524,-0.398957,0.343988,-1.8774,4.0725 +units=m +no_defs"
@@ -85,47 +85,50 @@ const m = {
85
85
  2154: {
86
86
  def: "+proj=lcc +lat_0=46.5 +lon_0=3 +lat_1=49 +lat_2=44 +x_0=700000 +y_0=6600000 +ellps=GRS80 +units=m +no_defs"
87
87
  },
88
+ // National grids a data file is likely to name (docs/design/crs.md, D5:
89
+ // bundle generously so the online lookup almost never fires). Definitions
90
+ // are epsg.io's own `.proj4` text, fetched 2026-10-06 and checked against
91
+ // PROJ 9.8 in projection.test.ts — not hand-derived.
92
+ 2193: { def: "+proj=tmerc +lat_0=0 +lon_0=173 +k=0.9996 +x_0=1600000 +y_0=10000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
93
+ // NZGD2000 / NZTM 2000
94
+ 3006: { def: "+proj=utm +zone=33 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
95
+ // SWEREF99 TM (Sweden)
96
+ 3035: { def: "+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
97
+ // ETRS89-extended / LAEA Europe
98
+ 3577: { def: "+proj=aea +lat_0=0 +lon_0=132 +lat_1=-18 +lat_2=-36 +x_0=0 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
99
+ // GDA94 / Australian Albers
100
+ 2326: { def: "+proj=tmerc +lat_0=22.3121333333333 +lon_0=114.178555555556 +k=1 +x_0=836694.05 +y_0=819069.8 +ellps=intl +towgs84=-162.619,-276.959,-161.764,-0.067753,2.243648,1.158828,-1.094246 +units=m +no_defs" },
101
+ // Hong Kong 1980 Grid
102
+ 5179: { def: "+proj=tmerc +lat_0=38 +lon_0=127.5 +k=0.9996 +x_0=1000000 +y_0=2000000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
103
+ // Korea 2000 / Unified CS
104
+ 3826: { def: "+proj=tmerc +lat_0=0 +lon_0=121 +k=0.9999 +x_0=250000 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs" },
105
+ // TWD97 / TM2 zone 121 (Taiwan)
106
+ // Geographic datums on GRS80 — longitude/latitude already, within a metre or
107
+ // two of WGS84; named so a file declaring one resolves offline.
108
+ 4269: { def: "+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs", geographic: !0 },
109
+ // NAD83
110
+ 4258: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0 },
111
+ // ETRS89
112
+ 4283: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0 },
113
+ // GDA94
114
+ 7844: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0 },
115
+ // GDA2020
116
+ 4167: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0 },
117
+ // NZGD2000
88
118
  // Japan — JGD2011 geographic 2D. EPSG axis order is (lat, lon).
89
119
  6668: { def: "+proj=longlat +ellps=GRS80 +no_defs", geographic: !0, swapXY: !0 },
90
120
  // WGS 84. Files in the wild store lon/lat despite EPSG's formal (lat, lon).
91
121
  4326: { def: "+proj=longlat +datum=WGS84 +no_defs", geographic: !0 },
92
122
  3857: { def: "+proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +no_defs" }
93
123
  };
94
- for (let t = 0; t < f.length; t++) {
95
- const [e, o] = f[t];
96
- u[6669 + t] = {
97
- def: `+proj=tmerc +lat_0=${e} +lon_0=${o} +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs`,
124
+ for (let e = 0; e < o.length; e++) {
125
+ const [l, s] = o[e];
126
+ _[6669 + e] = {
127
+ def: `+proj=tmerc +lat_0=${l} +lon_0=${s} +k=0.9999 +x_0=0 +y_0=0 +ellps=GRS80 +units=m +no_defs`,
98
128
  swapXY: !0
99
129
  };
100
130
  }
101
- let p = null;
102
- async function c() {
103
- return (await import("./index-CW1n5LdO.js")).default;
104
- }
105
- function j() {
106
- return p ??= c(), p;
107
- }
108
- function g() {
109
- return Object.keys(u).map(Number).sort((t, e) => t - e);
110
- }
111
- async function i(t, e, o) {
112
- const _ = m[t] ?? t, n = u[_];
113
- if (!n) return null;
114
- const [s, l] = n.swapXY ? [o, e] : [e, o];
115
- if (n.geographic) return [s, l];
116
- const a = await j(), [r, d] = a(n.def, "+proj=longlat +datum=WGS84 +no_defs").forward([s, l]);
117
- return Number.isFinite(r) && Number.isFinite(d) ? [r, d] : null;
118
- }
119
- async function y(t, e, o, _ = 100) {
120
- const n = await i(t, e, o), s = await i(t, e, o + _);
121
- if (!n || !s) return null;
122
- const l = (n[1] + s[1]) / 2 * Math.PI / 180, a = (s[0] - n[0]) * Math.cos(l), r = s[1] - n[1];
123
- return Math.atan2(a, r) * 180 / Math.PI;
124
- }
125
131
  export {
126
- m as COMPOUND_TO_HORIZONTAL,
127
- u as CRS_DEFS,
128
- g as bundledCrsCodes,
129
- y as gridConvergence,
130
- i as projectedToLonLat
132
+ t as COMPOUND_TO_HORIZONTAL,
133
+ _ as CRS_DEFS
131
134
  };
@@ -2,7 +2,12 @@ import type { Shape, ColumnarData, LayerData } from "./ir";
2
2
  export declare function isColumnar(data: LayerData): data is ColumnarData;
3
3
  /** `Array` as-is, or a FeatureCollection's `.features`, or a lone object wrapped in an array. */
4
4
  export declare function normalizeFeatures(json: unknown): unknown[];
5
- /** Parsed-JSON → LayerData: columnar `{ columns }` form, or the usual feature-array normalization. */
5
+ /**
6
+ * Parsed-JSON → LayerData: columnar `{ columns }` form, or the usual
7
+ * feature-array normalization. A legacy GeoJSON `crs` member is recorded
8
+ * against the result (docs/design/crs.md) — fetched and inline JSON both pass
9
+ * through here, so both are converted the same way.
10
+ */
6
11
  export declare function normalizeData(json: unknown): LayerData;
7
12
  /**
8
13
  * The one place the runtime reads a column value out of the ColumnarData
@@ -48,11 +53,30 @@ export interface ArrowTableLike {
48
53
  export declare function arrowTableToColumnar(table: ArrowTableLike, coordField?: string): ColumnarData;
49
54
  /** Arrow table → LayerData: line/polygon GeoArrow becomes GeoJSON feature rows; everything else takes the columnar path. */
50
55
  export declare function arrowTableToLayerData(table: ArrowTableLike): LayerData;
56
+ /** What a format's `parse` is told about the layer asking (docs/design/crs.md §3.4). */
57
+ export interface FormatContext {
58
+ /** The layer's declared `crs`, if any — what the author says the source is in. */
59
+ crs?: string;
60
+ }
61
+ /** A format result that states the CRS of the coordinates it returns. */
62
+ export interface FormatResult {
63
+ data: LayerData;
64
+ crs: string;
65
+ }
51
66
  export interface DataFormat {
52
67
  /** Claim a URL (extension test) and/or a response (Content-Type test — undefined during URL-only checks). */
53
68
  match(url: string, contentType?: string): boolean;
54
- /** Parse the claimed response. The parser module should be lazy-imported here (HU1 — the apache-arrow precedent). `url` is the requested URL (res.url is empty on constructed Responses — test fetches, service workers). */
55
- parse(res: Response, url: string): Promise<LayerData>;
69
+ /**
70
+ * Parse the claimed response. The parser module should be lazy-imported here (HU1 — the apache-arrow precedent). `url` is the requested URL (res.url is empty on constructed Responses — test fetches, service workers).
71
+ *
72
+ * CRS (docs/design/crs.md §3.4): `ctx.crs` is the layer's declared `crs`, for a
73
+ * plugin that converts coordinates itself (GDAL's `-s_srs`). Return
74
+ * `{ data, crs }` to say what the returned coordinates ARE — `crs: "EPSG:4326"`
75
+ * when the plugin already converted, so the map does not convert again. Bare
76
+ * `LayerData` means "as the file is": the map converts from the file's
77
+ * metadata or the declaration.
78
+ */
79
+ parse(res: Response, url: string, ctx?: FormatContext): Promise<LayerData | FormatResult>;
56
80
  /**
57
81
  * Optional progressive variant for record-per-line formats (CityJSONSeq):
58
82
  * `push` publishes a partial snapshot mid-download, taking the same
@@ -114,6 +138,8 @@ export interface StreamOptions {
114
138
  key?: string;
115
139
  flush?: string;
116
140
  refresh?: string;
141
+ /** The layer's declared `crs`, handed to a format's `parse` (docs/design/crs.md §3.4). */
142
+ crs?: string;
117
143
  }
118
144
  /**
119
145
  * Request configuration for every `data` URL the Data Layer fetches
@@ -149,6 +175,13 @@ export declare function isDrawUrl(url: string): boolean;
149
175
  * basemap tile URLs already use.
150
176
  */
151
177
  export declare function isTileTemplateUrl(url: string): boolean;
178
+ /**
179
+ * A tile template whose tiles are IMAGES (`…/{z}/{x}/{y}.png`) — what a bare
180
+ * `TileLayer` draws as bitmaps, and the one tiled source a projected map can
181
+ * warp into its plane (docs/design/crs.md, gap 2). One predicate, shared by the
182
+ * renderer and the validator, so they cannot disagree about which layers work.
183
+ */
184
+ export declare function isImageTileTemplate(url: string | null | undefined): boolean;
152
185
  /**
153
186
  * Push a new sketch snapshot into a `draw:<name>` store (the draw widget's
154
187
  * DrawSession.onChange calls this). A FRESH array reference is stored so
@@ -67,7 +67,8 @@ export declare class OmMapElement extends HTMLElementBase {
67
67
  private runtimeErrors;
68
68
  /** Layers whose `data` failed to load, as of the LAST reconcile — replaced
69
69
  * each pass (not accumulated like runtimeErrors), so a fixed URL clears. */
70
- private dataLoadFailures;
70
+ /** Per-parse data findings (failed loads, CRS problems) — replaced every reconcile. */
71
+ private dataDiagnostics;
71
72
  /** Host diagnostics channel (the `diagnostics` property) — see its setter. */
72
73
  private diagnosticsOn;
73
74
  /** The last merged static + runtime report, while anyone is listening. */
@@ -0,0 +1,30 @@
1
+ import { ae as i, af as m, ag as p } from "./index-DMc81n9B.js";
2
+ function y(e) {
3
+ if (e == null) return !0;
4
+ const t = e, o = t.id?.code;
5
+ return o != null ? o === 84 || o === 4326 || o === "CRS84" || o === "4326" : typeof t.name == "string" && /^\s*(ogc:)?(wgs\s*84|crs\s*84|wgs84)\s*$/i.test(t.name);
6
+ }
7
+ function g(e, t, o) {
8
+ const r = t.primary_column;
9
+ if (!r)
10
+ throw new Error(`data="${o}": GeoParquet "geo" metadata names no primary_column — can't tell which column is geometry.`);
11
+ const a = t.columns?.[r]?.crs, n = f(e, r, o);
12
+ return y(a) || i(n, a), n;
13
+ }
14
+ function f(e, t, o) {
15
+ if (e.length === 0)
16
+ return console.warn(`[onlymapjs] data="${o}": GeoParquet has no rows — empty layer.`), [];
17
+ const r = e.map((n) => n[t]);
18
+ if (r.every((n) => n != null && n.type === "Point")) {
19
+ const n = e.map(({ [t]: u, ...l }) => l), s = m(n), c = r.map((u) => u.coordinates ?? void 0);
20
+ return { length: e.length, columns: { ...s?.columns ?? {}, [t]: c } };
21
+ }
22
+ const a = e.map(({ [t]: n, ...s }) => {
23
+ const c = s.id;
24
+ return { type: "Feature", ...c != null ? { id: c } : {}, geometry: n ?? null, properties: s };
25
+ });
26
+ return p({ type: "FeatureCollection", features: a });
27
+ }
28
+ export {
29
+ g as geoParquetToLayerData
30
+ };
@@ -6,10 +6,9 @@
6
6
  * primary geometry column to GeoJSON geometry itself, so no WKB decoder is
7
7
  * ours to maintain.
8
8
  *
9
- * What IS ours: `geo` metadata validation, a CRS84 guard (deck.gl renders in
10
- * lng/lat — a projected file would land in the ocean, so a non-CRS84 CRS is a
11
- * loud structured error until the reprojection workstream lands, NOT a silent
12
- * skip the way GL does it), and the Arrow geometry rule from
9
+ * What IS ours: `geo` metadata validation, recording a non-CRS84 CRS against
10
+ * the result so the map converts it to lng/lat (docs/design/crs.md — this was a
11
+ * refusal until the data-CRS work landed), and the Arrow geometry rule from
13
12
  * `arrowTableToLayerData` — all-Point tables transpose to columnar (zero row
14
13
  * materialization on the render path), while lines/polygons/mixed become
15
14
  * GeoJSON feature rows that every geometry consumer speaks.
@@ -25,9 +24,9 @@ export interface GeoParquetMetadata {
25
24
  }>;
26
25
  }
27
26
  /**
28
- * hyparquet rows (geometry already decoded to GeoJSON) → LayerData, applying
29
- * the CRS guard and the Arrow all-Point-columnar / lines-polys-feature-rows
30
- * split. `rows` is consumed after the geo-metadata gate in data-layer's
27
+ * hyparquet rows (geometry already decoded to GeoJSON) → LayerData, recording
28
+ * the file's CRS and applying the Arrow all-Point-columnar /
29
+ * lines-polys-feature-rows split. `rows` is consumed after the geo-metadata gate in data-layer's
31
30
  * PARQUET_FORMAT.
32
31
  */
33
32
  export declare function geoParquetToLayerData(rows: Record<string, unknown>[], geo: GeoParquetMetadata, url: string): LayerData;
@@ -1,4 +1,4 @@
1
- import { d as L, j as x, a6 as A, a7 as E, a8 as d, a9 as h, aa as u, ab as z, p as V, W as Z, G as D } from "./index-CevWTqBO.js";
1
+ import { d as L, j as x, ah as A, ai as E, aj as d, ak as u, al as h, am as z, p as V, W as Z, G as D } from "./index-DMc81n9B.js";
2
2
  const c = Math.PI / 180, G = 180 / Math.PI;
3
3
  function w(l, t = 0) {
4
4
  const a = Math.min(180, l) * c;
@@ -8,7 +8,7 @@ function S(l, t = 0) {
8
8
  const a = l / Math.pow(2, t);
9
9
  return Math.asin(Math.min(1, a / z / 2)) * 2 * G;
10
10
  }
11
- class b extends A {
11
+ class T extends A {
12
12
  constructor(t) {
13
13
  const { startPanPos: a, ...o } = t;
14
14
  o.normalize = !1, super(o), a !== void 0 && (this._state.startPanPos = a);
@@ -41,9 +41,9 @@ class b extends A {
41
41
  }
42
42
  applyConstraints(t) {
43
43
  const { longitude: a, latitude: o, maxBounds: e } = t;
44
- if (t.zoom = this._constrainZoom(t.zoom, t), (a < -180 || a > 180) && (t.longitude = E(a + 180, 360) - 180), t.latitude = d(o, -h, h), e && (t.longitude = d(t.longitude, e[0][0], e[1][0]), t.latitude = d(t.latitude, e[0][1], e[1][1])), e) {
45
- const s = t.zoom - u(o), n = e[1][0] - e[0][0], i = e[1][1] - e[0][1];
46
- if (i > 0 && i < h * 2) {
44
+ if (t.zoom = this._constrainZoom(t.zoom, t), (a < -180 || a > 180) && (t.longitude = E(a + 180, 360) - 180), t.latitude = d(o, -u, u), e && (t.longitude = d(t.longitude, e[0][0], e[1][0]), t.latitude = d(t.latitude, e[0][1], e[1][1])), e) {
45
+ const s = t.zoom - h(o), n = e[1][0] - e[0][0], i = e[1][1] - e[0][1];
46
+ if (i > 0 && i < u * 2) {
47
47
  const r = Math.min(S(t.height, s), i) / 2;
48
48
  t.latitude = d(t.latitude, e[0][1] + r, e[1][1] - r);
49
49
  }
@@ -52,13 +52,13 @@ class b extends A {
52
52
  t.longitude = d(t.longitude, e[0][0] + r, e[1][0] - r);
53
53
  }
54
54
  }
55
- return t.latitude !== o && (t.zoom += u(t.latitude) - u(o)), t;
55
+ return t.latitude !== o && (t.zoom += h(t.latitude) - h(o)), t;
56
56
  }
57
57
  _constrainZoom(t, a) {
58
58
  a || (a = this.getViewportProps());
59
59
  const { latitude: o, maxZoom: e, maxBounds: s } = a;
60
60
  let { minZoom: n } = a;
61
- const i = u(0), r = u(o) - i;
61
+ const i = h(0), r = h(o) - i;
62
62
  if (s !== null && a.width > 0 && a.height > 0) {
63
63
  const g = s[0][1], M = s[1][1], _ = Math.sign(g) === Math.sign(M) ? Math.min(Math.abs(g), Math.abs(M)) : 0, P = w(s[1][0] - s[0][0]) * Math.cos(_ * c), f = w(s[1][1] - s[0][1]);
64
64
  P > 0 && (n = Math.max(n, Math.log2(a.width / P) + i)), f > 0 && (n = Math.max(n, Math.log2(a.height / f) + i)), n > e && (n = e);
@@ -66,9 +66,9 @@ class b extends A {
66
66
  return d(t, n + r, e + r);
67
67
  }
68
68
  }
69
- class T extends L {
69
+ class b extends L {
70
70
  constructor() {
71
- super(...arguments), this.ControllerState = b, this.transition = {
71
+ super(...arguments), this.ControllerState = T, this.transition = {
72
72
  transitionDuration: 300,
73
73
  transitionInterpolator: new x(["longitude", "latitude", "zoom"])
74
74
  }, this.dragMode = "pan";
@@ -94,11 +94,11 @@ class R extends V {
94
94
  return t.zoom > 12 ? Z : D;
95
95
  }
96
96
  get ControllerType() {
97
- return T;
97
+ return b;
98
98
  }
99
99
  }
100
100
  R.displayName = "GlobeView";
101
101
  export {
102
- T as G,
102
+ b as G,
103
103
  R as a
104
104
  };
@@ -0,0 +1,209 @@
1
+ import { c as F, a3 as M, a4 as T, a5 as H, a6 as $, a7 as B, a8 as x, a9 as E, aa as _, ab as D, ac as O } from "./index-DMc81n9B.js";
2
+ import { N as C, c as N } from "./hillshade-apron-Bem3DWyJ.js";
3
+ import { p as P, h as R, m as Z, a as U } from "./hillshade-shader-DI2uLSNU.js";
4
+ const A = 64, g = /* @__PURE__ */ new Map();
5
+ function S(t) {
6
+ const e = g.get(t);
7
+ if (e) return e;
8
+ const a = D(t);
9
+ if (g.set(t, a), g.size > A) {
10
+ const s = g.keys().next().value;
11
+ s !== void 0 && g.delete(s);
12
+ }
13
+ return a;
14
+ }
15
+ function z(t, e, a, s) {
16
+ return t.replace("{z}", String(s)).replace("{x}", String(e)).replace("{y}", String(a));
17
+ }
18
+ async function j(t, e, a) {
19
+ const s = await S(z(t, a.x, a.y, a.z));
20
+ if (!s) return null;
21
+ const u = (n) => ({
22
+ width: n.width,
23
+ height: n.height,
24
+ at: (c, r) => {
25
+ const h = (r * n.width + c) * 4;
26
+ return O(e, n.data[h], n.data[h + 1], n.data[h + 2]);
27
+ }
28
+ }), d = 2 ** a.z, p = /* @__PURE__ */ new Map();
29
+ return await Promise.all(
30
+ C.map(async ({ dx: n, dy: c }) => {
31
+ const r = a.y + c;
32
+ if (r < 0 || r >= d) return;
33
+ const h = ((a.x + n) % d + d) % d;
34
+ p.set(`${n},${c}`, await S(z(t, h, r, a.z)));
35
+ })
36
+ ), N(u(s), (n, c) => {
37
+ const r = p.get(`${n},${c}`);
38
+ return r ? u(r) : null;
39
+ });
40
+ }
41
+ const I = {
42
+ blendColorSrcFactor: "dst",
43
+ blendColorDstFactor: "zero",
44
+ blendAlphaSrcFactor: "zero",
45
+ blendAlphaDstFactor: "one"
46
+ };
47
+ class L extends _ {
48
+ static layerName = "HillshadeBitmapLayer";
49
+ getShaders() {
50
+ const e = super.getShaders();
51
+ return { ...e, modules: [...e.modules, U] };
52
+ }
53
+ draw(e) {
54
+ const a = this.props, s = { ...a.hillshadeUniforms, hillshadeHeights: a.image };
55
+ for (const u of this.getModels()) u.shaderInputs.setProps({ hillshade: s });
56
+ super.draw(e);
57
+ }
58
+ }
59
+ class W extends L {
60
+ static layerName = "WarpedHillshadeBitmapLayer";
61
+ _createMesh() {
62
+ const e = this.props, a = e._planeFrame, s = e._planeBounds;
63
+ return !a || !s ? super._createMesh() : E(s, a, e._subdivision ?? 1);
64
+ }
65
+ }
66
+ function k(t, e) {
67
+ if (!t) return e;
68
+ if (typeof t != "string") return t;
69
+ if (t in x) return x[t];
70
+ try {
71
+ const a = JSON.parse(t);
72
+ if ([a?.rScaler, a?.gScaler, a?.bScaler, a?.offset].every((s) => typeof s == "number" && Number.isFinite(s))) return a;
73
+ } catch {
74
+ }
75
+ return console.warn(`[onlymapjs] HillshadeLayer: decoder="${t}" is not "terrarium", "mapbox-rgb" or {rScaler,gScaler,bScaler,offset} JSON — using terrarium.`), e;
76
+ }
77
+ function J(t) {
78
+ const e = B(t.src);
79
+ return e ? e.requiresKey ? (console.warn(`[onlymapjs] HillshadeLayer: src="${t.src}" needs a ${e.requiresKey} key, which this layer does not plumb — use a keyless source such as "terrarium".`), null) : {
80
+ template: e.elevationData,
81
+ decoder: typeof e.decoder == "string" ? x[e.decoder] : e.decoder,
82
+ maxZoom: t.maxZoom ?? e.maxZoom
83
+ } : !t.src || !t.src.includes("{z}") ? (console.warn(`[onlymapjs] HillshadeLayer: src="${t.src}" is neither a registered terrain preset nor a {z}/{x}/{y} DEM URL template.`), null) : { template: t.src, decoder: k(t.decoder, x.terrarium), maxZoom: t.maxZoom ?? 14 };
84
+ }
85
+ function q(t, e) {
86
+ return !Number.isFinite(t) || !Number.isFinite(e) || e <= 0 ? 0 : Math.max(0, Math.round(Math.log2(Math.max(1, t / e))));
87
+ }
88
+ class Y extends F {
89
+ static layerName = "OmHillshadeLayer";
90
+ static defaultProps = {
91
+ src: { type: "string", value: "terrarium" },
92
+ decoder: { type: "string", value: null, optional: !0 },
93
+ sunAzimuth: { type: "string", value: "315" },
94
+ sunWeight: { type: "string", value: null, optional: !0 },
95
+ sunElevation: { type: "number", value: 45 },
96
+ zFactor: { type: "number", value: 1 },
97
+ blend: { type: "string", value: "normal" },
98
+ maxZoom: { type: "number", value: null, optional: !0 },
99
+ zoomOffset: { type: "number", value: 0 },
100
+ _planeFrame: { type: "object", value: null, optional: !0, compare: !1 },
101
+ sunDatum: { type: "string", value: "sheet" }
102
+ };
103
+ renderLayers() {
104
+ const e = J(this.props);
105
+ if (!e) return null;
106
+ const { azimuths: a, weights: s } = P(this.props.sunAzimuth, this.props.sunWeight), u = this.props.blend === "multiply", d = this.context.device, p = d?.canvasContext?.cssToDeviceRatio?.() ?? 1, n = typeof devicePixelRatio == "number" && devicePixelRatio > 0 ? devicePixelRatio : 1, c = this.state.textures, r = this.props._planeFrame ?? null, h = Math.max(1, p / n), v = this.props.sunDatum === "geographic";
107
+ return new M(
108
+ this.getSubLayerProps({ id: "tiles" }),
109
+ {
110
+ data: e.template,
111
+ tileSize: 256,
112
+ maxZoom: e.maxZoom,
113
+ // A plane view's viewport zoom is in PLANE units — about -12 for a
114
+ // continental Albers sheet, because a plane unit is a metre and a
115
+ // Mercator world unit at that latitude is sixty kilometres. TileLayer's
116
+ // `minZoom` gate compares the VIEWPORT's zoom against it, so deck's
117
+ // default of 0 hid every tile: they fetched, they were selected, and
118
+ // `renderSubLayers` was never called — no error anywhere. The tile
119
+ // PYRAMID's zoom range is a different number entirely, and the plane
120
+ // tileset applies it to the geographic zoom it derives.
121
+ ...r ? { TilesetClass: $(r), minZoom: -1 / 0 } : {},
122
+ zoomOffset: (this.props.zoomOffset ?? 0) + q(p, n),
123
+ // deck compares FUNCTION props by their update triggers, never by
124
+ // identity — inline closures would otherwise invalidate everything on
125
+ // every render. So anything a closure captures is invisible to deck
126
+ // unless it is declared here, which is why moving the sun with no
127
+ // trigger produced a byte-identical frame.
128
+ //
129
+ // The split is exactly the one we want. `getTileData` names only what
130
+ // changes the HEIGHTS, so a new decoder or source refetches; the
131
+ // illumination names `renderSubLayers`, which regenerates the draw
132
+ // calls and refetches nothing — moving the sun costs no network at
133
+ // all, because every knob below is a uniform.
134
+ updateTriggers: {
135
+ getTileData: [e.template, JSON.stringify(e.decoder)],
136
+ renderSubLayers: [a.join(","), s.join(","), this.props.sunElevation, this.props.zFactor, u, v, r?.projection.code ?? ""]
137
+ },
138
+ getTileData: async (i) => {
139
+ const o = await j(e.template, e.decoder, i.index);
140
+ if (!o || !d) return null;
141
+ const l = `${i.index.z}/${i.index.x}/${i.index.y}`;
142
+ c.get(l)?.destroy();
143
+ const m = d.createTexture({
144
+ data: o.data,
145
+ format: "r32float",
146
+ width: o.width + 2,
147
+ height: o.height + 2,
148
+ // NEAREST, because linear filtering of a float texture needs
149
+ // OES_texture_float_linear, which is not universal (the same
150
+ // constraint raster-pipeline.ts documents).
151
+ sampler: { minFilter: "nearest", magFilter: "nearest", addressModeU: "clamp-to-edge", addressModeV: "clamp-to-edge" }
152
+ });
153
+ return c.set(l, m), { texture: m, width: o.width, height: o.height, key: l };
154
+ },
155
+ onTileUnload: (i) => {
156
+ const o = `${i.index.z}/${i.index.x}/${i.index.y}`;
157
+ c.get(o)?.destroy(), c.delete(o);
158
+ },
159
+ renderSubLayers: (i) => {
160
+ const o = i.data;
161
+ if (!o) return null;
162
+ const l = i.tile, [[m, f], [b, y]] = r && l.lngLatBbox ? [[l.lngLatBbox.west, l.lngLatBbox.south], [l.lngLatBbox.east, l.lngLatBbox.north]] : l.boundingBox, w = r ? W : L;
163
+ return new w(i, {
164
+ id: `${i.id}-bitmap`,
165
+ data: void 0,
166
+ image: o.texture,
167
+ bounds: [m, f, b, y],
168
+ _planeFrame: r,
169
+ _planeBounds: r ? { west: m, south: f, east: b, north: y } : void 0,
170
+ _subdivision: r ? H(l.index.z, h) : 1,
171
+ multiply: u,
172
+ parameters: u ? I : {},
173
+ hillshadeUniforms: R({
174
+ width: o.width,
175
+ height: o.height,
176
+ azimuthOffset: r && !v ? T(r, [(m + b) / 2, (y + f) / 2]) : 0,
177
+ // Web Mercator: one scale for both axes, stated at the equator
178
+ // and given its cos-phi falloff per fragment by the shader.
179
+ ...Z(l.index.z, o.width, o.height),
180
+ north: y,
181
+ south: f,
182
+ azimuths: a,
183
+ weights: s,
184
+ sunElevation: this.props.sunElevation ?? 45,
185
+ zFactor: this.props.zFactor ?? 1,
186
+ // This layer's texture IS the heightfield, so there is no
187
+ // sampled colour to multiply into — a multiply-blended tile emits
188
+ // the shade and lets the GL blend put it in the framebuffer.
189
+ composite: u ? "framebuffer" : !1
190
+ })
191
+ });
192
+ }
193
+ }
194
+ );
195
+ }
196
+ initializeState() {
197
+ this.setState({ textures: /* @__PURE__ */ new Map() });
198
+ }
199
+ finalizeState() {
200
+ for (const e of this.state.textures.values()) e.destroy();
201
+ this.state.textures.clear();
202
+ }
203
+ }
204
+ export {
205
+ Y as OmHillshadeLayer,
206
+ j as buildPaddedHeights,
207
+ q as captureZoomOffset,
208
+ J as resolveHillshadeSource
209
+ };
@@ -15,7 +15,7 @@ interface TagData {
15
15
  }[];
16
16
  }
17
17
  /** Hand-authored action list — validated against hasAction() in html-data.test.ts. */
18
- export declare const BUILTIN_ACTIONS: readonly ["toggle-layer", "set-pickable", "set-layer-attribute", "expand-cluster", "zoom-in", "zoom-out", "filter-layer", "highlight-feature", "fade", "pulse", "populate", "trace", "story-play", "story-pause", "story-seek", "fly-to", "zoom-to-feature", "show-overlay", "hide-overlay", "show-tooltip", "hide-tooltip", "draw-mode", "draw-commit", "draw-cancel", "draw-delete", "draw-clear", "draw-config", "draw-save", "export-region-3d", "measure-mode", "measure-clear", "measure-units", "set-basemap", "set-effect", "set-lighting", "set-terrain", "set-clip-box", "clip-box-edit", "set-widgets-visible", "undo", "redo", "warm-tiles"];
18
+ export declare const BUILTIN_ACTIONS: readonly ["toggle-layer", "set-pickable", "set-layer-attribute", "expand-cluster", "zoom-in", "zoom-out", "filter-layer", "highlight-feature", "fade", "pulse", "populate", "trace", "story-play", "story-pause", "story-seek", "fly-to", "zoom-to-feature", "show-overlay", "hide-overlay", "show-tooltip", "hide-tooltip", "draw-mode", "draw-commit", "draw-cancel", "draw-delete", "draw-clear", "draw-config", "draw-save", "export-region-3d", "measure-mode", "measure-clear", "measure-units", "set-basemap", "set-projection", "set-effect", "set-lighting", "set-terrain", "set-clip-box", "clip-box-edit", "set-widgets-visible", "undo", "redo", "warm-tiles"];
19
19
  /** Hand-authored widget types — validated against the widget registry in html-data.test.ts.
20
20
  * Declared in `widget-types.ts` so the runtime validator can use it without
21
21
  * pulling this 42 KB table into the bundle. */
@@ -1,4 +1,4 @@
1
- import { projectedToLonLat as kt, gridConvergence as Bt, bundledCrsCodes as Ht } from "./crs-ChglCB3O.js";
1
+ import { projectedToLonLat as kt, gridConvergence as Bt, bundledCrsCodes as Ht } from "./crs-D5FyQfEu.js";
2
2
  const _t = "0.0.68", Rt = `https://unpkg.com/web-ifc@${_t}/`;
3
3
  let Tt = Rt;
4
4
  function Pe(t) {