@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.
- package/README.md +9 -3
- package/dist/attribute-resolution.d.ts +2 -0
- package/dist/{basemap-QT4ua-dL.js → basemap-CtDse0mW.js} +1514 -1462
- package/dist/basemap.d.ts +41 -1
- package/dist/cartograph.js +362 -321
- package/dist/cartograph.standalone.js +1995 -1914
- package/dist/{cityjson-k-z1r6c0.js → cityjson-DMc_dwu1.js} +1 -1
- package/dist/{crs-BzE_KP4M.js → crs-D5FyQfEu.js} +74 -7
- package/dist/{crs-ChglCB3O.js → crs-ZdDBJ2EY.js} +39 -36
- package/dist/data-layer.d.ts +36 -3
- package/dist/elements/om-map.d.ts +2 -1
- package/dist/geoparquet-BTHYX1ET.js +30 -0
- package/dist/geoparquet.d.ts +6 -7
- package/dist/{globe-view-BSGTUqWc.js → globe-view-KrKNOmVs.js} +11 -11
- package/dist/hillshade-CijRdYyU.js +209 -0
- package/dist/html-data.d.ts +1 -1
- package/dist/{ifc-DXwePQRv.js → ifc-sisRo7I7.js} +1 -1
- package/dist/{index-Bxue4Psc.js → index-21KGElDr.js} +9 -9
- package/dist/{index-DjYxw-8H.js → index-A45DtXly.js} +18 -18
- package/dist/{index-Dwc4s3mc.js → index-BPa2CC8T.js} +20 -20
- package/dist/{index-DudIuhJa.js → index-B_Vhebf7.js} +1 -1
- package/dist/{index-DBt_2x-w.js → index-Bfocr1_A.js} +106 -106
- package/dist/{index-CevWTqBO.js → index-DMc81n9B.js} +14362 -13782
- package/dist/{index-D1ZjhP2H.js → index-DS6VUGi6.js} +11 -11
- package/dist/{index-BO7MtTkn.js → index-DoGY-Vgi.js} +3 -3
- package/dist/{index-Bzypgr1v.js → index-eHYe06mM.js} +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/ir.d.ts +6 -0
- package/dist/layer-registry.d.ts +21 -0
- package/dist/layers/warped-bitmap-layer.d.ts +27 -0
- package/dist/{lerc-DQuf93SN.js → lerc-DjrPALEj.js} +1 -1
- package/dist/onlymap.standalone.js +53019 -52455
- package/dist/onlymapjs.js +86 -84
- package/dist/parse-manifest.d.ts +12 -9
- package/dist/{post-process-effect-B3j_nBzy.js → post-process-effect-Be1qa2DD.js} +5 -5
- package/dist/programmatic.d.ts +12 -0
- package/dist/projection.d.ts +44 -1
- package/dist/{raster-pipeline-CusoihQ3.js → raster-pipeline-DspBYxwc.js} +1 -1
- package/dist/{raster-CvAJ-h_g.js → raster-zC3qXBrs.js} +3 -3
- package/dist/react/om-layer.d.ts +4 -0
- package/dist/react/om-map.d.ts +2 -0
- package/dist/react.js +225 -218
- package/dist/runtime-core.d.ts +24 -0
- package/dist/source-crs.d.ts +99 -0
- package/dist/{text-on-path-D9u5SYCo.js → text-on-path-D0_URrD2.js} +1 -1
- package/dist/{zarr-DWb_nikR.js → zarr-DopOhzfY.js} +2 -2
- package/docs/cartography.md +106 -1
- package/llms.txt +2 -1
- package/onlymapjs.attributes.json +2 -0
- package/onlymapjs.html-data.json +26 -4
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +4 -2
- package/skills/onlymapjs/references/syntax.md +16 -1
- package/dist/geoparquet-hOsdfZJa.js +0 -35
- package/dist/hillshade-D2Ps3Nim.js +0 -298
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aC as tt, aD as et, aE as q, ab as nt, ac as ot, aF as C, aG as rt, aH as U, a7 as st, a8 as _, aI as L, aJ as it } from "./index-DMc81n9B.js";
|
|
2
2
|
const J = Math.PI / 180, T = tt * J;
|
|
3
3
|
function Q(t, r) {
|
|
4
4
|
const n = Math.max(Math.cos(r * J), 1e-6);
|
|
@@ -118,8 +118,8 @@ function mt(t) {
|
|
|
118
118
|
return n(t), r;
|
|
119
119
|
}
|
|
120
120
|
function dt(t, r, n) {
|
|
121
|
-
if (!
|
|
122
|
-
for (let o = 1; o < t.length; o++) if (
|
|
121
|
+
if (!q(t[0], r, n)) return !1;
|
|
122
|
+
for (let o = 1; o < t.length; o++) if (q(t[o], r, n)) return !1;
|
|
123
123
|
return !0;
|
|
124
124
|
}
|
|
125
125
|
function pt(t, r, n) {
|
|
@@ -191,7 +191,7 @@ function gt(t, r) {
|
|
|
191
191
|
}
|
|
192
192
|
return n;
|
|
193
193
|
}
|
|
194
|
-
function
|
|
194
|
+
function B(t, r, n, o, a) {
|
|
195
195
|
let s = 0;
|
|
196
196
|
o[0] = 0, a[0] = -$, a[1] = $;
|
|
197
197
|
for (let e = 1; e < r; e++) {
|
|
@@ -213,13 +213,13 @@ function W(t, r, n) {
|
|
|
213
213
|
const a = Math.max(r, n), s = new Float64Array(a), e = new Float64Array(a), f = new Int32Array(a), c = new Float64Array(a + 1);
|
|
214
214
|
for (let i = 0; i < r; i++) {
|
|
215
215
|
for (let u = 0; u < n; u++) s[u] = o[u * r + i];
|
|
216
|
-
|
|
216
|
+
B(s, n, e, f, c);
|
|
217
217
|
for (let u = 0; u < n; u++) o[u * r + i] = e[u];
|
|
218
218
|
}
|
|
219
219
|
for (let i = 0; i < n; i++) {
|
|
220
220
|
const u = i * r;
|
|
221
221
|
for (let l = 0; l < r; l++) s[l] = o[u + l];
|
|
222
|
-
|
|
222
|
+
B(s, r, e, f, c);
|
|
223
223
|
for (let l = 0; l < r; l++) o[u + l] = Math.sqrt(e[l]);
|
|
224
224
|
}
|
|
225
225
|
return o;
|
|
@@ -411,7 +411,7 @@ function It(t) {
|
|
|
411
411
|
return Math.atan(Math.sinh(Math.PI * (1 - 2 * t))) * 180 / Math.PI;
|
|
412
412
|
}
|
|
413
413
|
async function Pt(t) {
|
|
414
|
-
const [r, n, o, a] = t.bounds, s = Math.max(0, Math.round(t.zoom)), e =
|
|
414
|
+
const [r, n, o, a] = t.bounds, s = Math.max(0, Math.round(t.zoom)), e = C(r, a, s), f = C(o, n, s), c = Math.min(e.x, f.x), i = Math.max(e.x, f.x), u = Math.min(e.y, f.y), l = Math.max(e.y, f.y), y = (i - c + 1) * (l - u + 1);
|
|
415
415
|
if (y <= 0 || y > t.maxTiles) return null;
|
|
416
416
|
const h = (i - c + 1) * I, m = (l - u + 1) * I, d = new Float32Array(h * m), p = new Uint8Array(h * m), M = await Promise.all(
|
|
417
417
|
Array.from({ length: y }, (k, g) => {
|
|
@@ -425,8 +425,8 @@ async function Pt(t) {
|
|
|
425
425
|
const A = (k - c) * I, x = (g - u) * I, P = Math.min(I, b.height), R = Math.min(I, b.width);
|
|
426
426
|
for (let E = 0; E < P; E++)
|
|
427
427
|
for (let v = 0; v < R; v++) {
|
|
428
|
-
const X = (E * b.width + v) * 4,
|
|
429
|
-
d[
|
|
428
|
+
const X = (E * b.width + v) * 4, j = (x + E) * h + A + v;
|
|
429
|
+
d[j] = ot(t.decoder, b.data[X], b.data[X + 1], b.data[X + 2]), p[j] = 1;
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
432
|
const F = { width: h, height: m, cell: 1, originX: 0, originY: 0 }, w = 2 ** s;
|
|
@@ -493,7 +493,7 @@ async function Gt(t, r, n, o, a) {
|
|
|
493
493
|
S(a, '<om-transform type="simplify"> needs a tolerance with a unit.', 'Write tolerance="0.15mm" (paper) or tolerance="50m" (ground).');
|
|
494
494
|
break;
|
|
495
495
|
}
|
|
496
|
-
const c =
|
|
496
|
+
const c = L(f, o);
|
|
497
497
|
if (c == null) {
|
|
498
498
|
S(a, '<om-transform type="simplify"> has a tolerance in millimetres but this map declares no reference scale.', 'Add reference-scale="1:50000" to <om-map>, or author the tolerance in ground units (tolerance="50m").');
|
|
499
499
|
break;
|
|
@@ -545,7 +545,7 @@ async function Gt(t, r, n, o, a) {
|
|
|
545
545
|
S(a, '<om-transform type="buffer"> needs a distance with a unit.', 'Write distance="1.2mm" (paper) or distance="500m" (ground).');
|
|
546
546
|
break;
|
|
547
547
|
}
|
|
548
|
-
const c =
|
|
548
|
+
const c = L(f, o);
|
|
549
549
|
if (c == null) {
|
|
550
550
|
S(a, '<om-transform type="buffer"> has a distance in millimetres but this map declares no reference scale.', 'Add reference-scale="1:50000" to <om-map>, or author the distance in ground units (distance="500m").');
|
|
551
551
|
break;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as t, a as o, b as i, C as l, c as p, d as n, D as _, e as c, f as g, F as h, L as m, g as L, h as y, i as f, j as w, M as S, k as V, O as b, l as C, m as E, P as I, T as P, n as T, o as M, U as d, V as A, p as O, q as u, W as N, r as k, s as x, t as D, u as G, G as R, v as j, w as W, x as q, y as v, z, B as F, E as U, H as Y, I as B, J as H, K as J, N as K, Q, R as X, S as Z, X as $, Y as aa, Z as sa, _ as ea, $ as ra, a0 as ta, a1 as oa, a2 as ia } from "./index-
|
|
2
|
-
import { P as s } from "./post-process-effect-
|
|
3
|
-
import { G as pa, a as na } from "./globe-view-
|
|
1
|
+
import { A as t, a as o, b as i, C as l, c as p, d as n, D as _, e as c, f as g, F as h, L as m, g as L, h as y, i as f, j as w, M as S, k as V, O as b, l as C, m as E, P as I, T as P, n as T, o as M, U as d, V as A, p as O, q as u, W as N, r as k, s as x, t as D, u as G, G as R, v as j, w as W, x as q, y as v, z, B as F, E as U, H as Y, I as B, J as H, K as J, N as K, Q, R as X, S as Z, X as $, Y as aa, Z as sa, _ as ea, $ as ra, a0 as ta, a1 as oa, a2 as ia } from "./index-DMc81n9B.js";
|
|
2
|
+
import { P as s } from "./post-process-effect-Be1qa2DD.js";
|
|
3
|
+
import { G as pa, a as na } from "./globe-view-KrKNOmVs.js";
|
|
4
4
|
export {
|
|
5
5
|
t as AmbientLight,
|
|
6
6
|
o as Attribute,
|
package/dist/index.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ import { registerWidget } from "./widget-registry";
|
|
|
32
32
|
import { registerAction } from "./actions";
|
|
33
33
|
import { registerBasemap, configureBasemap } from "./basemap-registry";
|
|
34
34
|
import { registerTerrain } from "./terrain";
|
|
35
|
-
import { registerCrs } from "./projection";
|
|
35
|
+
import { registerCrs, configureCrs } from "./projection";
|
|
36
36
|
import { registerRoutingProvider } from "./providers";
|
|
37
37
|
import { configureTelemetry } from "./telemetry";
|
|
38
38
|
import { configureLicense, setKeepBadge, badgeMode } from "./license";
|
|
@@ -60,7 +60,7 @@ export type { BasemapPreset, BasemapStyle } from "./basemap-registry";
|
|
|
60
60
|
export { LIGHTING_PRESET_NAMES, resolveLighting, solarAzElDegrees } from "./scene-lighting";
|
|
61
61
|
export type { LightingIR, LightingOptions, LightingPresetName } from "./scene-lighting";
|
|
62
62
|
export { registerTerrain, getTerrain, parseTerrainAttrs } from "./terrain";
|
|
63
|
-
export { registerCrs, resolveProjection, registeredCrsCodes } from "./projection";
|
|
63
|
+
export { registerCrs, resolveProjection, registeredCrsCodes, configureCrs, resolveCrs, type CrsConfig } from "./projection";
|
|
64
64
|
export type { Projection, PlaneUnits, LngLatPair, PlaneXY } from "./projection";
|
|
65
65
|
export type { TerrainPreset, TerrainIR, ElevationDecoder, LayerTerrainMode } from "./terrain";
|
|
66
66
|
export { registerRoutingProvider, getRoutingProvider, lineStringLengthMeters } from "./providers";
|
|
@@ -136,6 +136,7 @@ export declare const OmMap: {
|
|
|
136
136
|
registerBasemap: typeof registerBasemap;
|
|
137
137
|
registerTerrain: typeof registerTerrain;
|
|
138
138
|
registerCrs: typeof registerCrs;
|
|
139
|
+
configureCrs: typeof configureCrs;
|
|
139
140
|
registerRoutingProvider: typeof registerRoutingProvider;
|
|
140
141
|
configureBasemap: typeof configureBasemap;
|
|
141
142
|
configureData: typeof configureData;
|
package/dist/ir.d.ts
CHANGED
|
@@ -153,4 +153,10 @@ export interface LayerIR {
|
|
|
153
153
|
* host class when this is set.
|
|
154
154
|
*/
|
|
155
155
|
cluster?: ClusterOptions;
|
|
156
|
+
/**
|
|
157
|
+
* The layer's source CRS is still resolving (docs/design/crs.md): its data is
|
|
158
|
+
* the empty placeholder until proj4 loads or epsg.io answers, and readiness
|
|
159
|
+
* waits on it the way it waits on a pending data URL.
|
|
160
|
+
*/
|
|
161
|
+
crsPending?: boolean;
|
|
156
162
|
}
|
package/dist/layer-registry.d.ts
CHANGED
|
@@ -119,6 +119,27 @@ export interface LayerSchema {
|
|
|
119
119
|
export declare const MERCATOR_PYRAMID_TYPES: readonly string[];
|
|
120
120
|
/** Whether this type draws Mercator-pyramid tiles and has NOT been taught the plane. */
|
|
121
121
|
export declare function needsMercatorPyramid(type: string): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Layer types that cannot draw on a globe (docs/design/globe.md), each with
|
|
124
|
+
* the reason the validation error gives. Measured 2026-10-08 on the basemap
|
|
125
|
+
* globe (MapLibre's sphere, deck's GlobeView over it):
|
|
126
|
+
*
|
|
127
|
+
* - Screen-space aggregation has no globe path in deck: HeatmapLayer drew
|
|
128
|
+
* nothing and logged a shader binding error; HexagonLayer collapsed to a
|
|
129
|
+
* speck. Grid, ScreenGrid and Contour share the machinery.
|
|
130
|
+
* - TerrainLayer is unsupported by deck's GlobeView.
|
|
131
|
+
* - ArcLayer (and GreatCircleLayer, built on it) drew a speck and stray
|
|
132
|
+
* fragments in space, with or without `great-circle`. PathLayer draws on the
|
|
133
|
+
* surface and is the route to suggest.
|
|
134
|
+
* - Text and icon quads are wound the other way round from the surface, and
|
|
135
|
+
* GlobeView culls back faces to hide the far side of the planet — so every
|
|
136
|
+
* glyph and icon is culled. Turning culling off draws them, far side and
|
|
137
|
+
* all, through the planet. Until labels learn the globe, these refuse.
|
|
138
|
+
*
|
|
139
|
+
* Listed here, not in the validator, so "what draws on a globe" has one home,
|
|
140
|
+
* as MERCATOR_PYRAMID_TYPES does for projected maps.
|
|
141
|
+
*/
|
|
142
|
+
export declare const NOT_ON_GLOBE: Readonly<Record<string, string>>;
|
|
122
143
|
export declare function registerLayer(schema: Omit<LayerSchema, "tier"> & {
|
|
123
144
|
tier?: LayerSchema["tier"];
|
|
124
145
|
}): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An image tile drawn on a projected map (docs/design/crs.md, gap 2).
|
|
3
|
+
*
|
|
4
|
+
* `BitmapLayer` builds its mesh from `bounds`, interpolating linearly between
|
|
5
|
+
* four corners — exactly a Mercator rectangle, and exactly wrong in any other
|
|
6
|
+
* projection, where a Web Mercator tile is a curved quadrilateral. Overriding
|
|
7
|
+
* `_createMesh` is the whole warp: the tile is subdivided and each vertex is
|
|
8
|
+
* projected on the CPU through `projection.ts`, and the GPU interpolates the
|
|
9
|
+
* texture across each warped quad. The technique, the subdivision rule and its
|
|
10
|
+
* measured error are the relief layer's (`plane-warp.ts`, carto-substrate §9);
|
|
11
|
+
* this is that warp without the shading.
|
|
12
|
+
*/
|
|
13
|
+
import { BitmapLayer } from "@deck.gl/layers";
|
|
14
|
+
import { type TileBoundsLngLat } from "../plane-warp";
|
|
15
|
+
import type { PlaneFrame } from "../projection";
|
|
16
|
+
export interface WarpedBitmapProps {
|
|
17
|
+
/** The map's projection plane. Absent → a plain BitmapLayer. */
|
|
18
|
+
_planeFrame?: PlaneFrame | null;
|
|
19
|
+
/** The tile's geographic extent — what the mesh projects. */
|
|
20
|
+
_planeBounds?: TileBoundsLngLat;
|
|
21
|
+
/** Cells per axis (`subdivisionFor`). */
|
|
22
|
+
_subdivision?: number;
|
|
23
|
+
}
|
|
24
|
+
export declare class WarpedBitmapLayer extends BitmapLayer<WarpedBitmapProps> {
|
|
25
|
+
static layerName: string;
|
|
26
|
+
protected _createMesh(): import("../plane-warp").WarpMesh;
|
|
27
|
+
}
|