@nika-js/onlymap 0.6.4 → 0.6.11
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 +45 -0
- package/README.md +7 -5
- package/dist/{LercDecode.es-D5in29tf.js → LercDecode.es-C331HMjV.js} +1 -1
- package/dist/attribute-resolution.d.ts +84 -6
- package/dist/{basemap-C0pFT3AO.js → basemap-NN5SYEaS.js} +1 -1
- package/dist/ctx.d.ts +3 -1
- package/dist/declarative-filter.d.ts +14 -5
- package/dist/elements/om-map.d.ts +20 -0
- package/dist/{geoparquet-By98JVB0.js → geoparquet-Dmyu5Oou.js} +1 -1
- package/dist/{index-Cxo9mCw_.js → index-BUp4hR6r.js} +17917 -17152
- package/dist/{index-tnlYDALL.js → index-CNxSRD27.js} +2 -2
- package/dist/{index-CqC4sW_k.js → index-CSVtCpQL.js} +1 -1
- package/dist/{index-olfncHIq.js → index-D28RTVKt.js} +1 -1
- package/dist/{index-Bx9GFkrn.js → index-_vNbcONa.js} +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/ir-snapshot.d.ts +2 -1
- package/dist/ir.d.ts +47 -9
- package/dist/layer-registry.d.ts +7 -0
- package/dist/layers/marker-icons.d.ts +30 -0
- package/dist/layers/route-layer.d.ts +103 -0
- package/dist/layers/tracking-layer.d.ts +55 -0
- package/dist/{lerc-gKDDtc69.js → lerc-Cryu98-R.js} +2 -2
- package/dist/license.d.ts +11 -14
- package/dist/onlymap.standalone.js +47864 -47099
- package/dist/onlymapjs.js +64 -61
- package/dist/programmatic.d.ts +20 -1
- package/dist/providers.d.ts +48 -0
- package/dist/{raster-Cl5m3KsC.js → raster-BVzTnbhW.js} +2 -2
- package/dist/{raster-pipeline-hJGxIwYx.js → raster-pipeline-FAPzre9S.js} +1 -1
- package/dist/react/om-layer.d.ts +6 -2
- package/dist/react.js +54 -50
- package/dist/runtime-core.d.ts +21 -0
- package/dist/tracking-interpolation.d.ts +22 -0
- package/dist/version.d.ts +1 -1
- package/dist/{zarr-hRDavRGV.js → zarr-DCWSzKoG.js} +2 -2
- package/docs/routing.md +111 -0
- package/llms.txt +5 -4
- package/onlymapjs.html-data.json +77 -3
- package/package.json +1 -1
- package/skills/onlymapjs/SKILL.md +4 -2
- package/skills/onlymapjs/references/syntax.md +84 -4
package/dist/onlymapjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { aA as e, aB as r, aC as t, aD as o, aE as b, aF as i, ap as l, aG as n, aH as S, aI as
|
|
1
|
+
import { aA as e, aB as r, aC as t, aD as o, aE as b, aF as i, ap as l, aG as n, aH as S, aI as g, aJ as c, aK as E, aL as L, aM as T, aN as A, aO as d, aP as p, aQ as m, aR as _, aS as I, aT as u, aU as M, aV as y, aW as D, ao as O, aX as R, aw as f, aY as N, aZ as P, a_ as h, W as F, a$ as B, b0 as C, b1 as v, b2 as G, b3 as U, b4 as W, b5 as w, b6 as x, b7 as Y, b8 as H, b9 as X, ba as k, bb as J, bc as K, bd as V, be as z, bf as Q, bg as Z, bh as $, bi as j, bj as q, bk as aa, bl as sa, bm as ea, bn as ra, bo as ta, bp as oa, bq as ba, br as ia, bs as la, bt as na, bu as Sa, bv as ga, bw as ca, bx as Ea, by as La, bz as Ta, bA as Aa, bB as da, bC as pa, bD as ma, bE as _a, bF as Ia, bG as ua, bH as Ma, bI as ya, bJ as Da, bK as Oa, bL as Ra, bM as fa, bN as Na, bO as Pa, bP as ha, bQ as Fa, bR as Ba, bS as Ca, bT as va, bU as Ga, bV as Ua, bW as Wa, bX as wa, bY as xa, bZ as Ya, b_ as Ha, b$ as Xa, c0 as ka, c1 as Ja, c2 as Ka, c3 as Va, c4 as za, c5 as Qa, c6 as Za } from "./index-BUp4hR6r.js";
|
|
2
2
|
export {
|
|
3
3
|
e as ALL_POSITION_VALUES,
|
|
4
4
|
r as AUDIT_EXEMPTIONS,
|
|
@@ -9,34 +9,34 @@ export {
|
|
|
9
9
|
l as CompositeLayer,
|
|
10
10
|
n as DEFAULT_AUDIT_WIDTHS,
|
|
11
11
|
S as DEFAULT_FOLD_BREAKPOINT_PX,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
g as DRONE_SENSOR_DATABASE,
|
|
13
|
+
c as EDGE_TOLERANCE_PX,
|
|
14
|
+
E as FOLD_HYSTERESIS_PX,
|
|
15
|
+
L as FOLD_SIDES,
|
|
16
|
+
T as GeoJsonLayer,
|
|
17
17
|
A as IconLayer,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
d as LEGACY_POSITION_ALIASES,
|
|
19
|
+
p as LIGHTING_PRESET_NAMES,
|
|
20
|
+
m as Layer,
|
|
21
|
+
_ as LayerExtension,
|
|
22
22
|
I as MANAGED_SLOTS,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
u as MapController,
|
|
24
|
+
M as OmMap,
|
|
25
|
+
y as ScatterplotLayer,
|
|
26
|
+
D as ScenegraphLayer,
|
|
27
27
|
O as SimpleMeshLayer,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
R as Tile3DLayer,
|
|
29
|
+
f as TileLayer,
|
|
30
|
+
N as UNIT_SYSTEMS,
|
|
31
31
|
P as WGS84_MEAN_RADIUS_M,
|
|
32
32
|
h as WIDGET_STYLE_KEY_NAMES,
|
|
33
33
|
F as WebMercatorViewport,
|
|
34
34
|
B as arrowTableToColumnar,
|
|
35
35
|
C as asRows,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
v as auditLayout,
|
|
37
|
+
G as compileExpression,
|
|
38
|
+
U as compileFullJsAccessorBlockInSandbox,
|
|
39
|
+
W as computeTimeline,
|
|
40
40
|
w as configureBasemap,
|
|
41
41
|
x as configureData,
|
|
42
42
|
Y as configureIfc,
|
|
@@ -57,47 +57,50 @@ export {
|
|
|
57
57
|
ea as getEntitlements,
|
|
58
58
|
ra as getLayerSchema,
|
|
59
59
|
ta as getMeasureRadiusMeters,
|
|
60
|
-
oa as
|
|
61
|
-
ba as
|
|
62
|
-
ia as
|
|
63
|
-
la as
|
|
64
|
-
na as
|
|
65
|
-
Sa as
|
|
60
|
+
oa as getRoutingProvider,
|
|
61
|
+
ba as getTerrain,
|
|
62
|
+
ia as isBrowser,
|
|
63
|
+
la as isColumnar,
|
|
64
|
+
na as isStoreToken,
|
|
65
|
+
Sa as lineStringLengthMeters,
|
|
66
|
+
ga as loadIfc,
|
|
67
|
+
ca as loadRasterModule,
|
|
66
68
|
Ea as midpoint,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
La as mountForTest,
|
|
70
|
+
Ta as niceNumber,
|
|
71
|
+
Aa as normalizeData,
|
|
72
|
+
da as parseDurationMs,
|
|
73
|
+
pa as parseTerrainAttrs,
|
|
74
|
+
ma as parseUnitSystem,
|
|
75
|
+
_a as parseWidgetStyle,
|
|
76
|
+
Ia as pathLengthMeters,
|
|
77
|
+
ua as registerAction,
|
|
78
|
+
Ma as registerBasemap,
|
|
77
79
|
ya as registerFormat,
|
|
78
80
|
Da as registerLayer,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
81
|
+
Oa as registerRoutingProvider,
|
|
82
|
+
Ra as registerSource,
|
|
83
|
+
fa as registerTerrain,
|
|
84
|
+
Na as registerWidget,
|
|
85
|
+
Pa as releaseDataOwner,
|
|
86
|
+
ha as resolveFoldBreakpointPx,
|
|
87
|
+
Fa as resolveImageOverlay,
|
|
88
|
+
Ba as resolveLighting,
|
|
89
|
+
Ca as resolveSlot,
|
|
90
|
+
va as ringAreaMeters2,
|
|
91
|
+
Ga as ringEnclosesPole,
|
|
92
|
+
Ua as ringPerimeterMeters,
|
|
93
|
+
Wa as rowAt,
|
|
94
|
+
wa as sandboxHtml,
|
|
95
|
+
xa as scaleBarStep,
|
|
96
|
+
Ya as setMeasureRadiusMeters,
|
|
97
|
+
Ha as settleLayout,
|
|
98
|
+
Xa as shouldFoldAtWidth,
|
|
99
|
+
ka as slotContainerStyle,
|
|
100
|
+
Ja as slotLayout,
|
|
101
|
+
Ka as snapshotDescriptorIR,
|
|
102
|
+
Va as snapshotIR,
|
|
103
|
+
za as solarAzElDegrees,
|
|
104
|
+
Qa as validateManifest,
|
|
105
|
+
Za as validateManifestString
|
|
103
106
|
};
|
package/dist/programmatic.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { type TokenStore, type ViewOrigin, type ViewportSnapshot, type DataVersi
|
|
|
22
22
|
import type { LayerIR } from "./ir";
|
|
23
23
|
import { type RuntimeContext } from "./ctx";
|
|
24
24
|
import type { LayerMetaSnapshot } from "./ctx";
|
|
25
|
+
import { type LayerFilterFieldSpec, type LayerCategoryFilterFieldSpec } from "./attribute-resolution";
|
|
25
26
|
import { type DataTransportOwner } from "./data-layer";
|
|
26
27
|
import type { Selection } from "./selection";
|
|
27
28
|
import type { ValidationEntry } from "./validation";
|
|
@@ -50,12 +51,16 @@ export interface LayerDescriptor {
|
|
|
50
51
|
/** Legend metadata (ctx.layers), same as the label/color attributes. */
|
|
51
52
|
label?: string;
|
|
52
53
|
color?: string;
|
|
53
|
-
/** GPU filter (spec: "Filtering") — mirrors filter-field/filter-range/… */
|
|
54
|
+
/** GPU filter (spec: "Filtering") — mirrors filter-field/filter-range/… (single dimension). */
|
|
54
55
|
filterField?: string;
|
|
55
56
|
filterRange?: [number, number];
|
|
56
57
|
filterSoftRange?: [number, number];
|
|
58
|
+
/** Multi-dimension GPU filter (up to 4) — mirrors `filter-fields`. Wins over `filterField`/`filterRange` if both are set. */
|
|
59
|
+
filterFields?: LayerFilterFieldSpec[];
|
|
57
60
|
filterCategoryField?: string;
|
|
58
61
|
filterCategories?: unknown[];
|
|
62
|
+
/** Multi-dimension categorical GPU filter (up to 4) — mirrors `filter-category-fields`. Wins over `filterCategoryField`/`filterCategories` if both are set. */
|
|
63
|
+
filterCategoryFields?: LayerCategoryFilterFieldSpec[];
|
|
59
64
|
/** Dashed lines on a path layer (spec: "PathStyleExtension") — `[dashLength, gapLength]` in line-width units; mirrors the `dash` attribute. */
|
|
60
65
|
dash?: [number, number];
|
|
61
66
|
/** Stretch each segment's dashes to start and end on a dash (deck `dashJustified`); mirrors `dash-justified`. */
|
|
@@ -118,6 +123,20 @@ export interface MapControllerOptions {
|
|
|
118
123
|
onMapPoint?: (coordinate: [number, number] | null, kind: "click" | "hover") => void;
|
|
119
124
|
/** A Tile3DLayer finished loading its root tileset — the `om-tileset-load` DOM event's twin; `tileset` is the live deck `Tileset3D`. */
|
|
120
125
|
onTilesetLoad?: (layerId: string, tileset: unknown) => void;
|
|
126
|
+
/** A Route layer finished resolving — the `om-route-resolved` DOM event's twin; `route` carries the normalized geometry/distanceMeters/durationSec/legs/bounds. */
|
|
127
|
+
onRouteResolved?: (layerId: string, route: {
|
|
128
|
+
geometry?: {
|
|
129
|
+
type: "LineString";
|
|
130
|
+
coordinates: [number, number][];
|
|
131
|
+
};
|
|
132
|
+
distanceMeters?: number;
|
|
133
|
+
durationSec?: number;
|
|
134
|
+
legs?: {
|
|
135
|
+
distanceMeters: number;
|
|
136
|
+
durationSec: number;
|
|
137
|
+
}[];
|
|
138
|
+
bounds?: [[number, number], [number, number]];
|
|
139
|
+
}) => void;
|
|
121
140
|
/** A `pick-features` layer decoded its property table — the DOM front-end's internal `featureTables` bookkeeping, surfaced here since `ctx.features()` depends on it (see `RuntimeCoreCallbacks.onFeatureTable`). */
|
|
122
141
|
onFeatureTable?: (layerId: string, rows: Record<string, unknown>[]) => void;
|
|
123
142
|
/** A `carriesGeoreference` layer (BIMLayer) finished loading and read its own file's georeferencing (see `RuntimeCoreCallbacks.onGeoreference`). No front end auto-applies terrain (what-you-write-is-what-you-see) — call `controller.setTerrain(...)` from here if you want a reaction. `approximatePlacement` mirrors the DOM lane's data-quality warning. */
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Routing provider registry (spec: "Routing & Tracking", v0.6.7). A
|
|
3
|
+
* `RoutingProvider` computes a route from an origin/destination/waypoints
|
|
4
|
+
* request — kept swappable in code (a plugin registry, the
|
|
5
|
+
* `registerBasemap`/`registerTerrain` precedent) even though v1 ships
|
|
6
|
+
* exactly one concrete adapter (NIKA, below), so a second provider is a
|
|
7
|
+
* registry addition later, not a rewrite.
|
|
8
|
+
*
|
|
9
|
+
* Tracking deliberately has NO separate provider abstraction here: per the
|
|
10
|
+
* design doc, live position updates ride the EXISTING data/source streaming
|
|
11
|
+
* machinery (`OmMap.registerSource`) — a tracking feed is just a
|
|
12
|
+
* `<om-layer type="Tracking">` whose `data` points at a `wss://` URL with a
|
|
13
|
+
* registered `SourcePlugin` decoder, nothing new to build for that half.
|
|
14
|
+
*/
|
|
15
|
+
export interface RouteWaypoint {
|
|
16
|
+
lng: number;
|
|
17
|
+
lat: number;
|
|
18
|
+
stop?: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface RouteRequest {
|
|
21
|
+
waypoints: RouteWaypoint[];
|
|
22
|
+
profile?: "driving" | "walking" | "cycling";
|
|
23
|
+
}
|
|
24
|
+
export interface RouteLeg {
|
|
25
|
+
distanceMeters: number;
|
|
26
|
+
durationSec: number;
|
|
27
|
+
}
|
|
28
|
+
/** Normalized route shape every provider returns — GeoJSON end-to-end (v1 ships GeoJSON only; encoded-polyline decoding is a deferred dependency, see the architecture doc). */
|
|
29
|
+
export interface Route {
|
|
30
|
+
geometry: {
|
|
31
|
+
type: "LineString";
|
|
32
|
+
coordinates: [number, number][];
|
|
33
|
+
};
|
|
34
|
+
distanceMeters: number;
|
|
35
|
+
/** `NaN` when no speed model exists to derive it (the direct-`geometry` authoring path) — a provider-computed route always supplies a real value. */
|
|
36
|
+
durationSec: number;
|
|
37
|
+
legs?: RouteLeg[];
|
|
38
|
+
}
|
|
39
|
+
export interface RoutingProvider {
|
|
40
|
+
computeRoute(request: RouteRequest, opts?: {
|
|
41
|
+
signal?: AbortSignal;
|
|
42
|
+
}): Promise<Route>;
|
|
43
|
+
}
|
|
44
|
+
export declare function registerRoutingProvider(name: string, provider: RoutingProvider): void;
|
|
45
|
+
export declare function getRoutingProvider(name: string): RoutingProvider | undefined;
|
|
46
|
+
/** Great-circle length of a LineString, in meters — used both by the direct-`geometry` authoring path (no provider round-trip needed for an already-computed route) and available to any provider adapter that needs it. */
|
|
47
|
+
export declare function lineStringLengthMeters(coordinates: readonly (readonly [number, number])[]): number;
|
|
48
|
+
export declare const nikaRoutingProvider: RoutingProvider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as re, t as Ae, i as nt, a as Re, s as rt, C as ot, b as it, F as at, A as st, d as lt, R as he, e as ct, p as ut, m as dt, f as ht, g as pt, h as gt } from "./raster-pipeline-
|
|
1
|
+
import { c as re, t as Ae, i as nt, a as Re, s as rt, C as ot, b as it, F as at, A as st, d as lt, R as he, e as ct, p as ut, m as dt, f as ht, g as pt, h as gt } from "./raster-pipeline-FAPzre9S.js";
|
|
2
2
|
import pe from "./index-CW1n5LdO.js";
|
|
3
3
|
function mt(e, t) {
|
|
4
4
|
const n = e.length / 3, r = new Uint8ClampedArray(n * 4), o = 0, i = n, a = n * 2;
|
|
@@ -1069,7 +1069,7 @@ A.set(m.Zstd, () => import("./zstd-jXobGRcq.js").then((e) => e.decode));
|
|
|
1069
1069
|
A.set(m.Jpeg, () => Promise.resolve(oe));
|
|
1070
1070
|
A.set(m.Jpeg6, () => Promise.resolve(oe));
|
|
1071
1071
|
A.set(m.Webp, () => Promise.resolve(oe));
|
|
1072
|
-
A.set(m.Lerc, () => import("./lerc-
|
|
1072
|
+
A.set(m.Lerc, () => import("./lerc-Cryu98-R.js").then((e) => e.l).then((e) => e.decode));
|
|
1073
1073
|
async function ie(e, t, n) {
|
|
1074
1074
|
const r = A.get(t);
|
|
1075
1075
|
if (!r)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { w as ae } from "./mgrs-BY9bIvp4.js";
|
|
2
|
-
import { am as ce, an as le, ao as ee, ap as te, aq as ue, b as he, ar as de, l as Z, as as fe, d as pe, at as me, au as ge, av as ve, aw as ne } from "./index-
|
|
2
|
+
import { am as ce, an as le, ao as ee, ap as te, aq as ue, b as he, ar as de, l as Z, as as fe, d as pe, at as me, au as ge, av as ve, aw as ne } from "./index-BUp4hR6r.js";
|
|
3
3
|
function Pe(o, e, t) {
|
|
4
4
|
const { projectedCorners: n } = e, { topLeft: s, topRight: r, bottomRight: a, bottomLeft: i } = n, c = t(s[0], s[1]), u = t(r[0], r[1]), l = t(a[0], a[1]), d = t(i[0], i[1]), f = [
|
|
5
5
|
c,
|
package/dist/react/om-layer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LayerDescriptor, Selection } from "@nika-js/onlymap";
|
|
1
|
+
import type { LayerDescriptor, LayerFilterFieldSpec, LayerCategoryFilterFieldSpec, Selection } from "@nika-js/onlymap";
|
|
2
2
|
export interface OmLayerProps {
|
|
3
3
|
/** Stable identity — same contract as the `id` attribute. */
|
|
4
4
|
id: string;
|
|
@@ -14,12 +14,16 @@ export interface OmLayerProps {
|
|
|
14
14
|
/** Legend metadata (ctx.layers). */
|
|
15
15
|
label?: string;
|
|
16
16
|
color?: string;
|
|
17
|
-
/** GPU filter (DataFilterExtension) — mirrors filter-field/filter-range. */
|
|
17
|
+
/** GPU filter (DataFilterExtension) — mirrors filter-field/filter-range (single dimension). */
|
|
18
18
|
filterField?: string;
|
|
19
19
|
filterRange?: [number, number];
|
|
20
20
|
filterSoftRange?: [number, number];
|
|
21
|
+
/** Multi-dimension GPU filter (up to 4) — mirrors `filter-fields`. Wins over `filterField`/`filterRange` if both are set. */
|
|
22
|
+
filterFields?: LayerFilterFieldSpec[];
|
|
21
23
|
filterCategoryField?: string;
|
|
22
24
|
filterCategories?: unknown[];
|
|
25
|
+
/** Multi-dimension categorical GPU filter (up to 4) — mirrors `filter-category-fields`. Wins over `filterCategoryField`/`filterCategories` if both are set. */
|
|
26
|
+
filterCategoryFields?: LayerCategoryFilterFieldSpec[];
|
|
23
27
|
/** Dashed path styling, mirroring `dash` / `dash-justified`. */
|
|
24
28
|
dash?: [number, number];
|
|
25
29
|
dashJustified?: boolean;
|
package/dist/react.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
var Ee = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var oe = (e, t, s) =>
|
|
2
|
+
var Fe = (e, t, s) => t in e ? Ee(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
|
+
var oe = (e, t, s) => Fe(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
4
|
import { jsxs as X, jsx as O } from "react/jsx-runtime";
|
|
5
|
-
import { createContext as
|
|
6
|
-
import { MANAGED_SLOTS as
|
|
5
|
+
import { createContext as Re, useContext as xe, forwardRef as Ce, useRef as h, useState as j, useId as ce, useCallback as se, useMemo as L, useLayoutEffect as ie, useEffect as R, useImperativeHandle as Te, useSyncExternalStore as de } from "react";
|
|
6
|
+
import { MANAGED_SLOTS as Pe, slotContainerStyle as ke, FOLD_SIDES as A, MapController as Le, parseWidgetStyle as Me, foldToggleSlot as $e, foldToggleStyle as je, foldPanelStyle as De, foldDrawerStyle as _e, resolveFoldBreakpointPx as Ae, shouldFoldAtWidth as Ie, DEFAULT_FOLD_BREAKPOINT_PX as ze, resolveSlot as Ke, foldSideForSlot as He, isStoreToken as Ne } from "@nika-js/onlymap";
|
|
7
7
|
import { createPortal as ue } from "react-dom";
|
|
8
|
-
const fe =
|
|
8
|
+
const fe = Re(null);
|
|
9
9
|
function W(e) {
|
|
10
|
-
const t =
|
|
10
|
+
const t = xe(fe);
|
|
11
11
|
if (!t) throw new Error(`[onlymapjs] ${e} must be rendered inside <OmMap>.`);
|
|
12
12
|
return t;
|
|
13
13
|
}
|
|
@@ -33,7 +33,7 @@ class qe {
|
|
|
33
33
|
this.descriptors.delete(t) && this.controller.setLayers([...this.descriptors.values()]);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
const N =
|
|
36
|
+
const N = Pe, Ve = Object.fromEntries(N.map((e) => [e, ke(e)])), ae = { display: "flex", pointerEvents: "none", order: 2147483647 }, Be = Object.fromEntries(A.map((e) => [e, null]));
|
|
37
37
|
function Je(e) {
|
|
38
38
|
const t = e.querySelector(
|
|
39
39
|
'button:not([disabled]),a[href],input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])'
|
|
@@ -43,10 +43,10 @@ function Je(e) {
|
|
|
43
43
|
function Ye(e, t) {
|
|
44
44
|
return Object.entries(t).some(([s, o]) => o !== void 0 && e[s] !== o);
|
|
45
45
|
}
|
|
46
|
-
const nt =
|
|
47
|
-
const { center: o, zoom: i, pitch: m, bearing: c, basemap: l, basemapKey: g, attribution: p, headless: d, widgetStyle:
|
|
46
|
+
const nt = Ce(function(t, s) {
|
|
47
|
+
const { center: o, zoom: i, pitch: m, bearing: c, basemap: l, basemapKey: g, attribution: p, headless: d, widgetStyle: x, widgetsHidden: v, widgetsFold: b = !0, className: y, style: C, children: w } = t, E = h(null), P = h(null), [a, M] = j(null), [k, q] = j(null), [T, D] = j(
|
|
48
48
|
() => Object.fromEntries(N.map((r) => [r, null]))
|
|
49
|
-
), [
|
|
49
|
+
), [F, I] = j(!1), [V, me] = j(Be), [ge, ye] = j(
|
|
50
50
|
() => Object.fromEntries(A.map((r) => [r, 0]))
|
|
51
51
|
), [be, B] = j(null), Z = `om-react-fold-${ce().replaceAll(":", "")}`, he = h(new Map(A.map((r) => [r, /* @__PURE__ */ new Set()]))), ee = d ? JSON.stringify(d) : "", z = h({
|
|
52
52
|
badge: null,
|
|
@@ -88,9 +88,9 @@ const nt = Te(function(t, s) {
|
|
|
88
88
|
if (f(r.getBoundingClientRect().width || (d ? d === !0 ? 800 : d.width ?? 800 : 0)), typeof ResizeObserver > "u") return;
|
|
89
89
|
const S = new ResizeObserver(([_]) => f(_.contentRect.width));
|
|
90
90
|
return S.observe(r), () => S.disconnect();
|
|
91
|
-
}, [b, ee]),
|
|
92
|
-
(!
|
|
93
|
-
}, [
|
|
91
|
+
}, [b, ee]), R(() => {
|
|
92
|
+
(!F || v) && B(null);
|
|
93
|
+
}, [F, v]);
|
|
94
94
|
const re = h({ center: o, zoom: i, pitch: m, bearing: c });
|
|
95
95
|
re.current = { center: o, zoom: i, pitch: m, bearing: c };
|
|
96
96
|
const K = h(t.onReady);
|
|
@@ -103,10 +103,10 @@ const nt = Te(function(t, s) {
|
|
|
103
103
|
J.current = l;
|
|
104
104
|
const Y = h(void 0);
|
|
105
105
|
ie(() => {
|
|
106
|
-
if (!
|
|
106
|
+
if (!P.current) return;
|
|
107
107
|
const r = re.current;
|
|
108
108
|
Y.current = J.current;
|
|
109
|
-
const n = new Le(
|
|
109
|
+
const n = new Le(P.current, {
|
|
110
110
|
center: r.center,
|
|
111
111
|
zoom: r.zoom,
|
|
112
112
|
pitch: r.pitch,
|
|
@@ -132,13 +132,13 @@ const nt = Te(function(t, s) {
|
|
|
132
132
|
}), () => {
|
|
133
133
|
u = !1, M(null), n.destroy();
|
|
134
134
|
};
|
|
135
|
-
}, [ee]),
|
|
135
|
+
}, [ee]), R(() => {
|
|
136
136
|
!a || Y.current === l || (Y.current = l, a.setBasemap(l ?? null));
|
|
137
|
-
}, [a, l]),
|
|
137
|
+
}, [a, l]), Te(s, () => a, [a]), R(() => {
|
|
138
138
|
if (!a) return;
|
|
139
139
|
const r = { longitude: o == null ? void 0 : o[0], latitude: o == null ? void 0 : o[1], zoom: i, pitch: m, bearing: c };
|
|
140
140
|
Ye(a.getViewState(), r) && a.setView(r);
|
|
141
|
-
}, [a, o == null ? void 0 : o[0], o == null ? void 0 : o[1], i, m, c]),
|
|
141
|
+
}, [a, o == null ? void 0 : o[0], o == null ? void 0 : o[1], i, m, c]), R(() => {
|
|
142
142
|
var r;
|
|
143
143
|
if (a)
|
|
144
144
|
return (r = $.current) == null || r.call($, a.getViewState()), a.getStore("viewport").subscribe(() => {
|
|
@@ -153,15 +153,15 @@ const nt = Te(function(t, s) {
|
|
|
153
153
|
zIndex: 20,
|
|
154
154
|
pointerEvents: "none",
|
|
155
155
|
opacity: "var(--om-widget-opacity, 1)",
|
|
156
|
-
...
|
|
156
|
+
...x ? Me(x).properties : void 0
|
|
157
157
|
}),
|
|
158
|
-
[
|
|
158
|
+
[x]
|
|
159
159
|
), G = L(() => a ? new qe(a) : null, [a]), ne = L(
|
|
160
|
-
() => a && G && k ? { controller: a, layers: G, overlayPane: k, corners:
|
|
161
|
-
[a, G, k,
|
|
160
|
+
() => a && G && k ? { controller: a, layers: G, overlayPane: k, corners: T, widgetsHidden: !!v, widgetsFolded: F, foldPanels: V, registerFoldedWidget: te } : null,
|
|
161
|
+
[a, G, k, T, v, F, V, te]
|
|
162
162
|
);
|
|
163
|
-
return /* @__PURE__ */ X("div", { ref: E, className: y, style: { position: "relative", overflow: "hidden", ...
|
|
164
|
-
/* @__PURE__ */ O("div", { ref:
|
|
163
|
+
return /* @__PURE__ */ X("div", { ref: E, className: y, style: { position: "relative", overflow: "hidden", ...C }, children: [
|
|
164
|
+
/* @__PURE__ */ O("div", { ref: P, style: { position: "absolute", inset: 0 } }),
|
|
165
165
|
/* @__PURE__ */ O(
|
|
166
166
|
"div",
|
|
167
167
|
{
|
|
@@ -176,10 +176,10 @@ const nt = Te(function(t, s) {
|
|
|
176
176
|
ref: ve[r],
|
|
177
177
|
style: {
|
|
178
178
|
...Ve[r],
|
|
179
|
-
...
|
|
179
|
+
...F && r === "bottom-end" ? { bottom: "calc(var(--om-widget-inset-y, 12px) + 28px)" } : void 0
|
|
180
180
|
},
|
|
181
181
|
children: [
|
|
182
|
-
|
|
182
|
+
F && A.filter((n) => $e(n) === r && ge[n] > 0).map((n) => {
|
|
183
183
|
const u = be === n;
|
|
184
184
|
return /* @__PURE__ */ X(
|
|
185
185
|
"div",
|
|
@@ -262,8 +262,10 @@ const nt = Te(function(t, s) {
|
|
|
262
262
|
"filterField",
|
|
263
263
|
"filterRange",
|
|
264
264
|
"filterSoftRange",
|
|
265
|
+
"filterFields",
|
|
265
266
|
"filterCategoryField",
|
|
266
267
|
"filterCategories",
|
|
268
|
+
"filterCategoryFields",
|
|
267
269
|
"dash",
|
|
268
270
|
"dashJustified",
|
|
269
271
|
"source",
|
|
@@ -288,8 +290,10 @@ function Ue(e) {
|
|
|
288
290
|
filterField: e.filterField,
|
|
289
291
|
filterRange: e.filterRange,
|
|
290
292
|
filterSoftRange: e.filterSoftRange,
|
|
293
|
+
filterFields: e.filterFields,
|
|
291
294
|
filterCategoryField: e.filterCategoryField,
|
|
292
295
|
filterCategories: e.filterCategories,
|
|
296
|
+
filterCategoryFields: e.filterCategoryFields,
|
|
293
297
|
dash: e.dash,
|
|
294
298
|
dashJustified: e.dashJustified,
|
|
295
299
|
source: e.source,
|
|
@@ -303,13 +307,13 @@ function Ue(e) {
|
|
|
303
307
|
}
|
|
304
308
|
function ot(e) {
|
|
305
309
|
const { controller: t, layers: s } = W("OmLayer"), { id: o } = e, i = Ue(e);
|
|
306
|
-
|
|
310
|
+
R(() => {
|
|
307
311
|
s.upsert(i);
|
|
308
|
-
}),
|
|
312
|
+
}), R(() => () => s.remove(o), [s, o]);
|
|
309
313
|
const m = h(e.onClick);
|
|
310
314
|
m.current = e.onClick;
|
|
311
315
|
const c = h(e.onHover);
|
|
312
|
-
return c.current = e.onHover,
|
|
316
|
+
return c.current = e.onHover, R(
|
|
313
317
|
() => t.watchPicks((l) => {
|
|
314
318
|
var g, p, d;
|
|
315
319
|
if (l === null) {
|
|
@@ -322,14 +326,14 @@ function ot(e) {
|
|
|
322
326
|
), null;
|
|
323
327
|
}
|
|
324
328
|
function st({ position: e = "top-start", order: t, fold: s, className: o, style: i, children: m }) {
|
|
325
|
-
const { corners: c, widgetsHidden: l, widgetsFolded: g, foldPanels: p, registerFoldedWidget: d } = W("OmWidget"),
|
|
326
|
-
if (
|
|
329
|
+
const { corners: c, widgetsHidden: l, widgetsFolded: g, foldPanels: p, registerFoldedWidget: d } = W("OmWidget"), x = ce(), v = Ke(e) ?? "top-start", b = g && v !== "manual" && s !== "never", y = v === "manual" ? null : He(v);
|
|
330
|
+
if (R(() => {
|
|
327
331
|
if (y)
|
|
328
|
-
return d(y,
|
|
329
|
-
}, [y,
|
|
332
|
+
return d(y, x, b), () => d(y, x, !1);
|
|
333
|
+
}, [y, x, b, d]), v === "manual")
|
|
330
334
|
return /* @__PURE__ */ O("div", { className: o, style: { pointerEvents: "auto", ...i }, children: m });
|
|
331
|
-
const
|
|
332
|
-
return
|
|
335
|
+
const C = b && y ? p[y] : c[v];
|
|
336
|
+
return C ? ue(
|
|
333
337
|
/* @__PURE__ */ O(
|
|
334
338
|
"div",
|
|
335
339
|
{
|
|
@@ -345,7 +349,7 @@ function st({ position: e = "top-start", order: t, fold: s, className: o, style:
|
|
|
345
349
|
children: m
|
|
346
350
|
}
|
|
347
351
|
),
|
|
348
|
-
|
|
352
|
+
C
|
|
349
353
|
) : null;
|
|
350
354
|
}
|
|
351
355
|
function le(e, t, s, o) {
|
|
@@ -367,12 +371,12 @@ function it(e) {
|
|
|
367
371
|
m.current = e;
|
|
368
372
|
const c = L(() => {
|
|
369
373
|
const b = t.getStore("selection");
|
|
370
|
-
let y,
|
|
374
|
+
let y, C, w = null;
|
|
371
375
|
return {
|
|
372
376
|
subscribe: b.subscribe,
|
|
373
377
|
getSnapshot: () => {
|
|
374
|
-
const E = b.getSnapshot(), { anchorFrom:
|
|
375
|
-
return (E !== y || k !==
|
|
378
|
+
const E = b.getSnapshot(), { anchorFrom: P, layer: a, selectionType: M } = m.current, k = `${P ?? ""}|${a ?? ""}|${M ?? ""}`;
|
|
379
|
+
return (E !== y || k !== C) && (y = E, C = k, P === "selection" && le(E, a, M, t.getLastPickType()) && (w = E)), w;
|
|
376
380
|
}
|
|
377
381
|
};
|
|
378
382
|
}, [t]), l = de(
|
|
@@ -380,28 +384,28 @@ function it(e) {
|
|
|
380
384
|
c.getSnapshot,
|
|
381
385
|
c.getSnapshot
|
|
382
386
|
);
|
|
383
|
-
|
|
384
|
-
() => t.registerOverlay((b, y,
|
|
387
|
+
R(
|
|
388
|
+
() => t.registerOverlay((b, y, C) => {
|
|
385
389
|
const w = o.current;
|
|
386
390
|
if (!w) return;
|
|
387
|
-
const { anchor: E, anchorFrom:
|
|
388
|
-
let
|
|
389
|
-
if (
|
|
391
|
+
const { anchor: E, anchorFrom: P, layer: a, selectionType: M, visible: k = !0, anchorOffset: q } = m.current;
|
|
392
|
+
let T;
|
|
393
|
+
if (P === "selection" ? (le(y, a, M, C) && (i.current = (y == null ? void 0 : y.coordinate) ?? void 0), T = i.current) : T = E, !k || !T || !b) {
|
|
390
394
|
w.style.visibility = "hidden";
|
|
391
395
|
return;
|
|
392
396
|
}
|
|
393
|
-
const [D,
|
|
394
|
-
if (!(D >= 0 && D <= b.width &&
|
|
397
|
+
const [D, F, I] = b.project([T[0], T[1], T[2] ?? 0]);
|
|
398
|
+
if (!(D >= 0 && D <= b.width && F >= 0 && F <= b.height) || I !== void 0 && I < 0) {
|
|
395
399
|
w.style.visibility = "hidden";
|
|
396
400
|
return;
|
|
397
401
|
}
|
|
398
|
-
w.style.visibility = "visible", w.style.transform = `translate(${D}px, ${
|
|
402
|
+
w.style.visibility = "visible", w.style.transform = `translate(${D}px, ${F}px) ${Xe[q ?? "bottom-center"]}`;
|
|
399
403
|
}),
|
|
400
404
|
[t]
|
|
401
|
-
),
|
|
405
|
+
), R(() => {
|
|
402
406
|
t.refreshOverlays();
|
|
403
407
|
});
|
|
404
|
-
const { children: g, className: p, style: d, interactive:
|
|
408
|
+
const { children: g, className: p, style: d, interactive: x = !0 } = e, v = typeof g == "function" ? g(l) : g;
|
|
405
409
|
return ue(
|
|
406
410
|
/* @__PURE__ */ O(
|
|
407
411
|
"div",
|
|
@@ -415,7 +419,7 @@ function it(e) {
|
|
|
415
419
|
visibility: "hidden",
|
|
416
420
|
// hidden until the first flush positions it — never flashes at the origin
|
|
417
421
|
willChange: "transform",
|
|
418
|
-
pointerEvents:
|
|
422
|
+
pointerEvents: x ? "auto" : "none",
|
|
419
423
|
...d
|
|
420
424
|
},
|
|
421
425
|
children: v
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -8,6 +8,20 @@ import type { LayerIR } from "./ir";
|
|
|
8
8
|
import { type Selection } from "./selection";
|
|
9
9
|
import type { ValidationEntry } from "./validation";
|
|
10
10
|
import type { MapViewport } from "./basemap";
|
|
11
|
+
/** RouteLayer's own `onRouteResolved` report (spec: "Routing & Tracking") — a normalized Route plus its bounds. `bounds` drives `follow="fit-route"` here; the WHOLE object forwards to `RuntimeCoreCallbacks.onRouteResolved` (the `om-route-resolved` consumer event), so a page can read a provider-resolved route's geometry/distance/duration without re-fetching it. */
|
|
12
|
+
interface RouteResolvedInfo {
|
|
13
|
+
geometry?: {
|
|
14
|
+
type: "LineString";
|
|
15
|
+
coordinates: [number, number][];
|
|
16
|
+
};
|
|
17
|
+
distanceMeters?: number;
|
|
18
|
+
durationSec?: number;
|
|
19
|
+
legs?: {
|
|
20
|
+
distanceMeters: number;
|
|
21
|
+
durationSec: number;
|
|
22
|
+
}[];
|
|
23
|
+
bounds?: [[number, number], [number, number]];
|
|
24
|
+
}
|
|
11
25
|
/**
|
|
12
26
|
* The tile-level EXT_structural_metadata property-table index, resolved
|
|
13
27
|
* independently of `FeatureMeshLayer`'s own copy of this same computation.
|
|
@@ -153,6 +167,13 @@ export interface RuntimeCoreCallbacks {
|
|
|
153
167
|
* @loaders.gl/tiles type dependency in the core).
|
|
154
168
|
*/
|
|
155
169
|
onTilesetLoad?: (layerId: string, tileset: unknown) => void;
|
|
170
|
+
/**
|
|
171
|
+
* A `carriesRoute` layer (Route) finished resolving its route — direct
|
|
172
|
+
* `geometry` or a `RoutingProvider` round-trip alike. The `om-route-resolved`
|
|
173
|
+
* consumer event's source; `route` carries the normalized geometry/
|
|
174
|
+
* distanceMeters/durationSec/legs plus the fitted bounds.
|
|
175
|
+
*/
|
|
176
|
+
onRouteResolved?: (layerId: string, route: RouteResolvedInfo) => void;
|
|
156
177
|
/**
|
|
157
178
|
* A `carriesGeoreference` layer (BIMLayer) finished loading its source file
|
|
158
179
|
* and read whatever georeferencing it declares — `hasFullMapConversion`
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drives interpolation + follow-camera for `type="Tracking"` layers (spec:
|
|
3
|
+
* "Routing & Tracking"). Deliberately isolated from `RuntimeCore.reconcile`'s
|
|
4
|
+
* own internals — called as one line from that method, reusing the SAME
|
|
5
|
+
* per-frame channel `trace`/`pulse` already ride (`runLayerEffect`/
|
|
6
|
+
* `patchAnimatedProps`, src/effects.ts), not a parallel animation system.
|
|
7
|
+
*
|
|
8
|
+
* Position/bearing come from the layer's OWN already-resolved IR props (the
|
|
9
|
+
* compiled `getPosition` accessor, the `bearingField` name) — no new
|
|
10
|
+
* field-resolution kernel invented for this.
|
|
11
|
+
*/
|
|
12
|
+
import type { RuntimeCore } from "./runtime-core";
|
|
13
|
+
import type { LayerIR } from "./ir";
|
|
14
|
+
/** Shortest-path angle interpolation — a plain lerp on raw degrees would swing the long way around at the 0/360 wrap (350° → 10° should pass through 0°, not backward through 180°). Exported for direct unit testing (the `traceProgress`/`pulseOpacity` precedent in effects.ts — "pure math, unit-testable without a clock"). */
|
|
15
|
+
export declare function lerpAngle(a: number, b: number, t: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Called once per `reconcile()`, after `RuntimeCore.lastIRs` is updated —
|
|
18
|
+
* needs the PREVIOUS set (passed in explicitly) to detect a genuine new fix
|
|
19
|
+
* vs. an unrelated reconcile (a sibling layer's edit, a story step) that
|
|
20
|
+
* left this layer's `data` reference untouched.
|
|
21
|
+
*/
|
|
22
|
+
export declare function updateTrackingLayers(core: RuntimeCore, previousIRs: readonly LayerIR[], irs: readonly LayerIR[]): void;
|
package/dist/version.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, g as pr, h as mr } from "./raster-pipeline-
|
|
2
|
-
import { ap as gr } from "./index-
|
|
1
|
+
import { A as ur, d as lr, R as zt, e as fr, m as dr, p as St, f as hr, g as pr, h as mr } from "./raster-pipeline-FAPzre9S.js";
|
|
2
|
+
import { ap as gr } from "./index-BUp4hR6r.js";
|
|
3
3
|
import $t from "./index-CW1n5LdO.js";
|
|
4
4
|
var Et;
|
|
5
5
|
function h(e, t, n) {
|