@nika-js/onlymap 0.6.7 → 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.
@@ -1,5 +1,5 @@
1
- import { i as E, j as S, k as R, o as N, p as h, q as w, s as O, t as W, v as x, w as I, x as B, y as _, A as P, B as k, E as $, F as z, H as v, I as F, J as C, K as U, N as p, O as M } from "./index-CAuq7wRs.js";
2
- import { P as $e, R as ze, _ as ve, Q as Ce, S as Ue, T as Me, U as je, X as De, Y as Je, Z as qe, $ as He, a0 as Ve, a1 as Ge, a2 as Ke, a3 as Qe, a4 as Xe, a5 as Ye, a6 as Ze, a7 as et, a8 as tt, a9 as nt, aa as rt, ab as at, ac as st, ad as ot } from "./index-CAuq7wRs.js";
1
+ import { i as E, j as S, k as R, o as N, p as h, q as w, s as O, t as W, v as x, w as I, x as B, y as _, A as P, B as k, E as $, F as z, H as v, I as F, J as C, K as U, N as p, O as M } from "./index-BUp4hR6r.js";
2
+ import { P as $e, R as ze, _ as ve, Q as Ce, S as Ue, T as Me, U as je, X as De, Y as Je, Z as qe, $ as He, a0 as Ve, a1 as Ge, a2 as Ke, a3 as Qe, a4 as Xe, a5 as Ye, a6 as Ze, a7 as et, a8 as tt, a9 as nt, aa as rt, ab as at, ac as st, ad as ot } from "./index-BUp4hR6r.js";
3
3
  import { g as j, i as D } from "./table-accessors-CYWTzpQI.js";
4
4
  async function J(t, e, n = {}, r = {}) {
5
5
  const a = E(t), s = S.getWorkerFarm(n), { source: o } = n, c = { name: a, source: o };
@@ -1,4 +1,4 @@
1
- import { ae as _t, af as Ct } from "./index-CAuq7wRs.js";
1
+ import { ae as _t, af as Ct } from "./index-BUp4hR6r.js";
2
2
  function Yt(e, r, t = 2, i, o = "xy") {
3
3
  const s = r && r.length, l = s ? r[0] * t : e.length;
4
4
  let c = Ut(e, 0, l, t, !0, i && i[0], o);
@@ -1,4 +1,4 @@
1
- import { ag as Be, ah as le, ai as ce, aj as De, ak as Oe, al as ke } from "./index-CAuq7wRs.js";
1
+ import { ag as Be, ah as le, ai as ce, aj as De, ak as Oe, al as ke } from "./index-BUp4hR6r.js";
2
2
  import { y as ve, a as he, z as G, R as J, A as ue, C as Fe, F as je, n as xe, S as Ie, E as Ne } from "./recordbatch-Bpc0uxFn.js";
3
3
  import { g as V, a as fe, b as Le, c as Ue, d as Me, e as qe, m as Ve } from "./table-accessors-CYWTzpQI.js";
4
4
  import { c as $e } from "./convert-arrow-schema-DrAihRf9.js";
@@ -1,4 +1,4 @@
1
- import { ak as Bt, ax as Xt, ay as Yt, az as Us } from "./index-CAuq7wRs.js";
1
+ import { ak as Bt, ax as Xt, ay as Yt, az as Us } from "./index-BUp4hR6r.js";
2
2
  import { w as gs, t as Hs, f as Ws, m as Qs } from "./mgrs-BY9bIvp4.js";
3
3
  import { c as Xs } from "./convert-arrow-schema-DrAihRf9.js";
4
4
  import { y as Ys, A as bt, a as Ks, z as Vs, R as Zs } from "./recordbatch-Bpc0uxFn.js";
@@ -15,5 +15,16 @@ export interface IconDescriptor {
15
15
  }
16
16
  /** A dropped-pin marker (origin/destination waypoints on a `Route` layer). Anchored at its point (bottom of the pin), not its center. */
17
17
  export declare function pinIcon(color: string): IconDescriptor;
18
- /** A directional arrow marker (a `Tracking` layer's moving entity) — points "up" (north) at angle 0, rotated per-row via `getAngle`. */
18
+ declare const DIRECTIONAL_SVGS: {
19
+ readonly arrow: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">\n <circle cx=\"16\" cy=\"16\" r=\"14\" fill=\"COLOR\" fill-opacity=\"0.22\"/>\n <path d=\"M16 4 L24 26 L16 21 L8 26 Z\" fill=\"COLOR\"/>\n</svg>";
20
+ readonly car: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">\n <circle cx=\"16\" cy=\"16\" r=\"14\" fill=\"COLOR\" fill-opacity=\"0.22\"/>\n <rect x=\"10\" y=\"4.5\" width=\"12\" height=\"23\" rx=\"4\" fill=\"COLOR\"/>\n <rect x=\"12\" y=\"9.5\" width=\"8\" height=\"4.5\" rx=\"1.4\" fill=\"#0b1220\" fill-opacity=\"0.55\"/>\n <rect x=\"12\" y=\"21\" width=\"8\" height=\"3.5\" rx=\"1.4\" fill=\"#0b1220\" fill-opacity=\"0.55\"/>\n</svg>";
21
+ readonly motorcycle: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"32\" height=\"32\" viewBox=\"0 0 32 32\">\n <circle cx=\"16\" cy=\"16\" r=\"14\" fill=\"COLOR\" fill-opacity=\"0.22\"/>\n <rect x=\"14.3\" y=\"3.5\" width=\"3.4\" height=\"7\" rx=\"1.7\" fill=\"#64748b\"/>\n <rect x=\"14.3\" y=\"21.5\" width=\"3.4\" height=\"7\" rx=\"1.7\" fill=\"#64748b\"/>\n <rect x=\"9.5\" y=\"9.5\" width=\"13\" height=\"2.6\" rx=\"1.3\" fill=\"COLOR\"/>\n <path d=\"M16 10.5 C19 12 19.4 14 19 17.5 C18.7 20.5 17.6 23 16 23 C14.4 23 13.3 20.5 13 17.5 C12.6 14 13 12 16 10.5 Z\" fill=\"COLOR\"/>\n <circle cx=\"16\" cy=\"16.5\" r=\"3\" fill=\"#f8fafc\" fill-opacity=\"0.92\"/>\n</svg>";
22
+ };
23
+ /** The `Tracking` layer's curated marker set — `icon` attribute values. */
24
+ export type TrackingIconName = keyof typeof DIRECTIONAL_SVGS;
25
+ export declare function isTrackingIconName(v: unknown): v is TrackingIconName;
26
+ /** A directional marker (a `Tracking` layer's moving entity) — every shape points "up" (north) at angle 0, rotated per-row via `getAngle`. Unknown names fall back to the arrow (validation warns at author time). */
27
+ export declare function directionalIcon(name: TrackingIconName | string, color: string): IconDescriptor;
28
+ /** Back-compat alias — the original arrow-only builder. */
19
29
  export declare function arrowIcon(color: string): IconDescriptor;
30
+ export {};
@@ -33,6 +33,20 @@ type LineStringGeometry = {
33
33
  type: "LineString";
34
34
  coordinates: [number, number][];
35
35
  };
36
+ /**
37
+ * Splits a polyline at the point on it nearest to `point` (spec: "Routing &
38
+ * Tracking / tail modes"). Real GPS fixes sit OFF the line, so the split is a
39
+ * projection onto the nearest segment, not an exact-vertex match. Longitudes
40
+ * are scaled by cos(mid-latitude) before comparing distances — raw degrees
41
+ * would overweight longitude away from the equator and can pick the wrong
42
+ * segment on north–south routes. Both halves include the projected point, so
43
+ * `taken` ends exactly where `remaining` begins. Pure and exported for
44
+ * direct unit testing (the `lerpAngle` precedent).
45
+ */
46
+ export declare function splitLineAtNearestPoint(coordinates: readonly (readonly [number, number])[], point: readonly [number, number]): {
47
+ taken: [number, number][];
48
+ remaining: [number, number][];
49
+ };
36
50
  export interface RouteLayerProps {
37
51
  geometry?: LineStringGeometry | string;
38
52
  origin?: [number, number] | string;
@@ -42,6 +56,22 @@ export interface RouteLayerProps {
42
56
  profile?: "driving" | "walking" | "cycling";
43
57
  color?: string;
44
58
  casingColor?: string;
59
+ /**
60
+ * How the TRAVELED portion of the route renders, once `progress-from`
61
+ * supplies a current position (spec: "Routing & Tracking / tail modes"):
62
+ * "full" (default — whole route in `color`, the split is ignored),
63
+ * "dim" (operator view — traveled portion darkened, remaining in `color`),
64
+ * "none" (client view — only current position → destination renders, and
65
+ * the origin pin is dropped too: a start marker with no line reaching it
66
+ * reads as a stray point).
67
+ */
68
+ tail?: "full" | "dim" | "none";
69
+ /** Dim-mode tail color override; default derives a darkened `color`. */
70
+ tailColor?: string;
71
+ /** Id of the Tracking layer whose position splits this route — consumed by src/tracking-interpolation.ts (which patches `progressPosition` here per frame), not by this class directly. */
72
+ progressFrom?: string;
73
+ /** Injected per frame by src/tracking-interpolation.ts — never authored. */
74
+ progressPosition?: [number, number];
45
75
  /** Injected by runtime-core.ts (schema.carriesRoute) — never authored. */
46
76
  onRouteResolved?: (route: Route & RouteBounds) => void;
47
77
  [prop: string]: unknown;
@@ -66,6 +96,8 @@ export declare class RouteLayer extends CompositeLayer<RouteLayerProps> {
66
96
  }): void;
67
97
  finalizeState(): void;
68
98
  private resolveRoute;
99
+ /** One casing-or-line `PathLayer` — the repeated shape of every stroke below. */
100
+ private strokeLayer;
69
101
  renderLayers(): Layer[];
70
102
  }
71
103
  export {};
@@ -36,6 +36,8 @@ export interface TrackingLayerProps {
36
36
  bearingField?: string;
37
37
  color?: string;
38
38
  size?: number;
39
+ /** Marker shape: "arrow" (default), "car", or "motorcycle" — all drawn nose-up and baked in `color`, so rotation and tinting work identically. Unknown values fall back to the arrow (validation warns). */
40
+ icon?: string;
39
41
  /** Injected by src/tracking-interpolation.ts — never authored. */
40
42
  interpolatedPosition?: [number, number];
41
43
  interpolatedBearing?: number;
@@ -47,6 +49,7 @@ export declare class TrackingLayer extends CompositeLayer<TrackingLayerProps> {
47
49
  bearingField: string;
48
50
  color: string;
49
51
  size: number;
52
+ icon: string;
50
53
  };
51
54
  renderLayers(): Layer[];
52
55
  }
@@ -1,4 +1,4 @@
1
- import { C as a, D as s } from "./raster-DtyMY54Z.js";
1
+ import { C as a, D as s } from "./raster-BVzTnbhW.js";
2
2
  const D = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3
3
  __proto__: null
4
4
  }, Symbol.toStringTag, { value: "Module" }));
@@ -8,7 +8,7 @@ var t;
8
8
  })(t || (t = {}));
9
9
  let l = !1;
10
10
  async function d() {
11
- const e = await import("./LercDecode.es-BzboSQ2U.js");
11
+ const e = await import("./LercDecode.es-C331HMjV.js");
12
12
  return l || (await e.load(), l = !0), e;
13
13
  }
14
14
  async function i(e, r) {