@wemap/viewer 0.0.0-stage → 14.8.0-beta.4

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.
@@ -0,0 +1,149 @@
1
+ import { Coordinates } from '@wemap/geo';
2
+ import { ClickMode } from './graph/PanoramaPointer';
3
+ import { ViewerNode, ViewerOptions, OpenOptions, LocatedPoint, Measurement, VisionGeojsonGraph, ViewerPolygon, ViewerClick } from './types';
4
+ /** Events a {@link WemapViewer} emits. Subscribe with `viewer.on(...)`. */
5
+ export interface ViewerEvents {
6
+ /** Fired as soon as a move to a node starts, and again with the node still on screen if its image fails. */
7
+ navigate: ViewerNode;
8
+ /** Fired when the look heading changes (degrees). */
9
+ heading: number;
10
+ /** Fired once, when the first panorama is on screen. */
11
+ ready: void;
12
+ /** Fired with the position under a click, in `locate` click mode. */
13
+ locate: LocatedPoint;
14
+ /** Fired with the distance between two clicks, in `measure` click mode. */
15
+ measure: Measurement;
16
+ /** A click that walks nowhere, in `navigate` mode: above the horizon, or on the floor with no node there. */
17
+ click: ViewerClick;
18
+ }
19
+ /**
20
+ * Framework-agnostic 360° panorama viewer. Renders the Wemap image graph as an
21
+ * equirectangular sphere; moving to another node runs a panorama transition
22
+ * (see `transition/PanoramaTransition`).
23
+ *
24
+ * Requires `@wemap/core` to be initialized (`core.init()`) before use — it reads
25
+ * the VPS endpoint and emmid from `CoreConfig`.
26
+ *
27
+ * ```ts
28
+ * await core.init({ emmid, token });
29
+ * const viewer = new WemapViewer(el, { onNavigate: (id) => ... });
30
+ * await viewer.open(nodeId, { heading: 90 });
31
+ * ```
32
+ */
33
+ export declare class WemapViewer {
34
+ private container;
35
+ private options;
36
+ private scene;
37
+ private camera;
38
+ private renderer;
39
+ private sphereObject;
40
+ private sphere;
41
+ private transition;
42
+ private controls;
43
+ private pointer;
44
+ private measureOverlay;
45
+ private polygonOverlay;
46
+ /** First point of a measurement in progress (pixel of the shown image). */
47
+ private measureStart;
48
+ /** Bumped on every reset, so a late answer for a cleared measurement is dropped. */
49
+ private measureRun;
50
+ private data;
51
+ private nodes;
52
+ private graph;
53
+ private current;
54
+ /** Settles when the current node's image is on screen (or overtaken). */
55
+ private arrival;
56
+ private geojson;
57
+ private listeners;
58
+ private turn;
59
+ private readyFired;
60
+ private rafId;
61
+ private resizeObserver;
62
+ constructor(container: HTMLElement, options?: ViewerOptions);
63
+ /**
64
+ * Open the viewer on a node: by id, or the nearest node to a position (on its
65
+ * level when it has one). The first call fetches the image graph. Resolves once
66
+ * that node's image is on screen, or once a later move overtakes it; rejects if
67
+ * the node is unknown or the graph or the image fails to load.
68
+ *
69
+ * `heading` / `pitch` (degrees) set where to look: instantly on the first open,
70
+ * as an animated turn after that. Without them the look direction is kept.
71
+ */
72
+ open(target: number | Coordinates, options?: OpenOptions): Promise<void>;
73
+ /**
74
+ * Fetch the image graph without opening a photo, e.g. to find the nearest
75
+ * node or draw the graph before showing anything. Fetched once and shared
76
+ * with `open()`; a failed fetch is retried by the next call.
77
+ */
78
+ loadGraph(): Promise<ViewerNode[]>;
79
+ /** Look at a heading: instantly before anything is on screen, animated after. */
80
+ private face;
81
+ /** The nodes of the image graph (empty until `loadGraph()` or the first `open()` has fetched it). */
82
+ getNodes(): ViewerNode[];
83
+ get currentNode(): ViewerNode | null;
84
+ /**
85
+ * The graph as GeoJSON (LineString edges + Point nodes), for drawing on a map.
86
+ * Fetched and cached on first call. Used by the `@wemap/viewer-map` bridge.
87
+ */
88
+ getGraphGeojson(): Promise<VisionGeojsonGraph>;
89
+ /**
90
+ * Subscribe to a viewer event. Returns an unsubscribe function. Unlike the
91
+ * `onXxx` constructor options (single callback each), any number of listeners
92
+ * can subscribe here — this is what the map bridges use.
93
+ */
94
+ on<K extends keyof ViewerEvents>(event: K, callback: (payload: ViewerEvents[K]) => void): () => void;
95
+ private emit;
96
+ /**
97
+ * Move to another node by id; no-op if unknown or already current. `navigate`
98
+ * fires right away. If the node's image then fails to load, the viewer goes
99
+ * back to the node still on screen (`navigate` again) and reports `onError`.
100
+ */
101
+ navigateTo(nodeId: number): void;
102
+ /**
103
+ * Make `node` current and bring its image on screen. The camera (lon/lat) is
104
+ * left untouched: the look direction is a real-world compass heading, so the
105
+ * user keeps facing the same way. On failure, falls back to the
106
+ * node still on screen.
107
+ */
108
+ private moveTo;
109
+ private fireReady;
110
+ private setCurrent;
111
+ /**
112
+ * Node closest to a geo position, on `level` when given. Null when the graph
113
+ * is not loaded yet (see `loadGraph()`) or has no node on that level.
114
+ */
115
+ nearestNode(to: Coordinates, level?: number): ViewerNode | null;
116
+ private closestNode;
117
+ /**
118
+ * Draw these polygons over the panorama, replacing the ones drawn before; an
119
+ * empty list clears them. They are anchored in the world, so they follow the
120
+ * user from node to node. The panorama has no depth: a polygon behind a wall
121
+ * still shows.
122
+ */
123
+ setPolygons(polygons: ViewerPolygon[]): void;
124
+ /** Turn to a compass heading and pitch (degrees), animated the short way round. */
125
+ lookAt(heading: number, pitch?: number): void;
126
+ resize(): void;
127
+ /** Tear down the renderer, controls, observers and DOM. */
128
+ destroy(): void;
129
+ /** What a click on the panorama does: walk (`navigate`, the default), `locate` or `measure`. */
130
+ get clickMode(): ClickMode;
131
+ /**
132
+ * Switch what a click on the panorama does, instead of walking:
133
+ * - `locate`: a click reports the geo position under it (`locate` / `onLocate`).
134
+ * - `measure`: two clicks report the distance between the two points
135
+ * (`measure` / `onMeasure`), drawn as two dots and a line; a third click
136
+ * clears them.
137
+ */
138
+ setClickMode(mode: ClickMode): void;
139
+ /** One click of a measurement: first point, second point (then measure), or clear. */
140
+ private measureAt;
141
+ private clearMeasurement;
142
+ /** Locate what is under a click, from the shown node's image and the VPS depth. */
143
+ private locateAt;
144
+ /** Current look heading in degrees (0 = north, clockwise). */
145
+ getHeading(): number;
146
+ private emitHeading;
147
+ private animate;
148
+ }
149
+ //# sourceMappingURL=WemapViewer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WemapViewer.d.ts","sourceRoot":"","sources":["../../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IAAI;IAI5C,mFAAmF;IACnF,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,SAAI,GAAG,IAAI;IAoBxC,MAAM,IAAI,IAAI;IAUd,2DAA2D;IAC3D,OAAO,IAAI,IAAI;IAiBf,gGAAgG;IAChG,IAAI,SAAS,IAAI,SAAS,CAEzB;IAED;;;;;;OAMG;IACH,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI;IAMnC,sFAAsF;YACxE,SAAS;IAkCvB,OAAO,CAAC,gBAAgB;IAMxB,mFAAmF;YACrE,QAAQ;IAgBtB,8DAA8D;IAC9D,UAAU,IAAI,MAAM;IAIpB,OAAO,CAAC,WAAW,CAIjB;IAEF,OAAO,CAAC,OAAO,CASb;CACH"}
@@ -0,0 +1,63 @@
1
+ import { EventDispatcher, Object3D, PerspectiveCamera } from 'three';
2
+ export interface SphereControlsConfig {
3
+ zoomEnable?: boolean;
4
+ minFov?: number;
5
+ maxFov?: number;
6
+ }
7
+ type Events = {
8
+ change: object;
9
+ start: object;
10
+ end: object;
11
+ };
12
+ /**
13
+ * Drag / wheel / keyboard orbit controller for looking around an equirectangular
14
+ * sphere, with inertia; its animations run on the viewer's shared tween group.
15
+ */
16
+ declare class SphereControls extends EventDispatcher<Events> {
17
+ config: SphereControlsConfig;
18
+ minFov: number;
19
+ maxFov: number;
20
+ defaultFov: number;
21
+ _autoRotate: boolean;
22
+ autoRotateSpeed: number;
23
+ sensibility: number;
24
+ camera: PerspectiveCamera;
25
+ sphere: Object3D;
26
+ _lat: number;
27
+ _lon: number;
28
+ isUserInteracting: boolean;
29
+ onMouseDownMouseX: number;
30
+ onMouseDownMouseY: number;
31
+ onMouseDownLon: number;
32
+ onMouseDownLat: number;
33
+ autoRotateTimestamp: number;
34
+ private isArrowKeyPressed;
35
+ private currentTween;
36
+ private velocityLon;
37
+ private velocityLat;
38
+ private lastMouseX;
39
+ private lastMouseY;
40
+ private lastUpdateTime;
41
+ private animationFrameId;
42
+ private element;
43
+ constructor(element: HTMLElement, camera: PerspectiveCamera, sphere: Object3D, config?: SphereControlsConfig);
44
+ /** Detach every listener. Call from the viewer's `destroy()`. */
45
+ dispose(): void;
46
+ get lat(): number;
47
+ set lat(lat: number);
48
+ get lon(): number;
49
+ set lon(lon: number);
50
+ get autoRotate(): boolean;
51
+ set autoRotate(autoRotate: boolean);
52
+ updateFov(fov: number): void;
53
+ retrieveLatLonFromCamera(): void;
54
+ onPointerStart: (event: TouchEvent | MouseEvent) => void;
55
+ onPointerMove: (event: TouchEvent | MouseEvent) => void;
56
+ onPointerUp: (event: TouchEvent | MouseEvent) => void;
57
+ onDocumentMouseWheel: (event: WheelEvent) => void;
58
+ private onKeyDown;
59
+ update(): void;
60
+ private updateVelocity;
61
+ }
62
+ export default SphereControls;
63
+ //# sourceMappingURL=SphereControls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SphereControls.d.ts","sourceRoot":"","sources":["../../../src/controls/SphereControls.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,eAAe,EAEf,KAAK,QAAQ,EACb,KAAK,iBAAiB,EAEvB,MAAM,OAAO,CAAC;AAef,MAAM,WAAW,oBAAoB;IACnC,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,KAAK,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D;;;GAGG;AACH,cAAM,cAAe,SAAQ,eAAe,CAAC,MAAM,CAAC;IAClD,MAAM,EAAE,oBAAoB,CAAC;IAE7B,MAAM,SAAM;IACZ,MAAM,SAAO;IACb,UAAU,SAAM;IAEhB,WAAW,UAAS;IACpB,eAAe,SAAQ;IAEvB,WAAW,SAAO;IAElB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,MAAM,EAAE,QAAQ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map a raw {@link VisionGraph} to renderable {@link ViewerNode}s. Pure — no
5
+ * network, no config — so it is unit-testable.
6
+ */
7
+ export declare function graphToNodes(graph: VisionGraph, imageUrl: (filename: string) => string): ViewerNode[];
8
+ /**
9
+ * Fetches the 360° image graph and resolves image URLs from the Wemap VPS
10
+ * endpoint. The endpoint comes from `@wemap/core` (`CoreConfig.getViewerOptions`)
11
+ * unless one is passed explicitly (e.g. for tests or staging).
12
+ */
13
+ export declare class ViewerDataClient {
14
+ private endpoint;
15
+ constructor(endpoint?: string);
16
+ imageUrl(filename: string): string;
17
+ getGraph(): Promise<VisionGraph>;
18
+ getGraphGeojson(): Promise<VisionGeojsonGraph>;
19
+ getNodes(): Promise<ViewerNode[]>;
20
+ /**
21
+ * Geo position of what is under pixel (x, y) of a node's image, from the
22
+ * VPS depth estimate. Takes the node's level when the answer has none.
23
+ */
24
+ locate(node: ViewerNode, x: number, y: number): Promise<Coordinates>;
25
+ /**
26
+ * Distance in metres between what is under two pixels of a node's image,
27
+ * from the VPS depth estimate.
28
+ */
29
+ measure(node: ViewerNode, from: [number, number], to: [number, number]): Promise<number>;
30
+ }
31
+ //# sourceMappingURL=ViewerDataClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewerDataClient.d.ts","sourceRoot":"","sources":["../../../src/data/ViewerDataClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,KAAK,EAAE,WAAW,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAU5E;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GACrC,UAAU,EAAE,CAad;AAED;;;;GAIG;AACH,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAS;gBAEb,QAAQ,CAAC,EAAE,MAAM;IAW7B,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM;IAIlC,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAIhC,eAAe,IAAI,OAAO,CAAC,kBAAkB,CAAC;IAIxC,QAAQ,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;IAKvC;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAQ1E;;;OAGG;IACG,OAAO,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;CAgB/F"}
@@ -0,0 +1,39 @@
1
+ import { Quaternion, Vector3 } from 'three';
2
+ import { Coordinates } from '@wemap/geo';
3
+ import { ViewerNode } from '../types';
4
+ /** Image `u` offset (turns) that aligns a node's image to north, given its capture heading. */
5
+ export declare function northOffset(captureHeading: number): number;
6
+ /**
7
+ * Image coordinates (u, v in 0..1) seen in `direction` for a node with this
8
+ * capture heading. TypeScript twin of the panorama shader's `equirect()`.
9
+ */
10
+ export declare function imageUv(direction: Vector3, captureHeading: number): [number, number];
11
+ /**
12
+ * Pixel (x right, y down from the top-left) of a node's equirectangular image
13
+ * seen in `direction`, for an image of `width` × `height` pixels.
14
+ */
15
+ export declare function imagePixel(direction: Vector3, captureHeading: number, width: number, height: number): [number, number];
16
+ /** Camera rotation that looks at a compass heading and pitch (degrees). */
17
+ export declare function lookRotation(heading: number, pitch?: number, out?: Quaternion): Quaternion;
18
+ /** Compass heading (degrees, 0..360) and pitch (degrees, positive up) of a scene direction. */
19
+ export declare function directionAngles(direction: Vector3): {
20
+ heading: number;
21
+ pitch: number;
22
+ };
23
+ /** Compass heading (degrees, 0..360) a camera rotation looks at. */
24
+ export declare function headingOf(rotation: Quaternion): number;
25
+ /** Position of `target` in the frame of a node at `origin`, at camera height (y = 0). */
26
+ export declare function toLocal(origin: Coordinates, target: Coordinates, out?: Vector3): Vector3;
27
+ /**
28
+ * Position of `target` in the frame of a node at `origin`, height included: y is
29
+ * the altitude difference. Both need an altitude, in the same reference.
30
+ */
31
+ export declare function toScene(origin: Coordinates, target: Coordinates, out?: Vector3): Vector3;
32
+ /** Geo position of a point in the frame of a node at `origin` (height ignored). */
33
+ export declare function toGeo(origin: Coordinates, point: Vector3): Coordinates;
34
+ /**
35
+ * How far the camera travels when going from one node to the next, in the
36
+ * frame of `from`. Zero (just cross-fade) across levels or beyond 8 m.
37
+ */
38
+ export declare function hop(from: ViewerNode | null, to: ViewerNode): Vector3;
39
+ //# sourceMappingURL=SceneFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SceneFrame.d.ts","sourceRoot":"","sources":["../../../src/frame/SceneFrame.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAa,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAY3C,+FAA+F;AAC/F,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAMpF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CACxB,SAAS,EAAE,OAAO,EAClB,cAAc,EAAE,MAAM,EACtB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,CAAC,MAAM,EAAE,MAAM,CAAC,CAGlB;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,SAAI,EAAE,GAAG,aAAmB,GAAG,UAAU,CAI3F;AAED,+FAA+F;AAC/F,wBAAgB,eAAe,CAAC,SAAS,EAAE,OAAO,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAMtF;AAED,oEAAoE;AACpE,wBAAgB,SAAS,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAGtD;AAED,yFAAyF;AACzF,wBAAgB,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,UAAgB,GAAG,OAAO,CAI9F;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,UAAgB,GAAG,OAAO,CAK9F;AAED,mFAAmF;AACnF,wBAAgB,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,GAAG,WAAW,CAItE;AAED;;;GAGG;AACH,wBAAgB,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,EAAE,EAAE,EAAE,UAAU,GAAG,OAAO,CAMpE"}
@@ -0,0 +1,19 @@
1
+ import { Scene, Vector3 } from 'three';
2
+ /**
3
+ * The measurement drawn over the panorama: a red dot (white
4
+ * ring) on each clicked point and a red dashed line once there are two.
5
+ * Positions are view directions in the scene frame.
6
+ */
7
+ export declare class MeasureOverlay {
8
+ private readonly scene;
9
+ private readonly group;
10
+ constructor(scene: Scene);
11
+ /** Number of points placed (0, 1 or 2). */
12
+ get count(): number;
13
+ /** Place a point in `direction`; the second one also draws the line. */
14
+ add(direction: Vector3): void;
15
+ /** Remove every point and the line. */
16
+ clear(): void;
17
+ dispose(): void;
18
+ }
19
+ //# sourceMappingURL=MeasureOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MeasureOverlay.d.ts","sourceRoot":"","sources":["../../../src/graph/MeasureOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAUL,KAAK,KAAK,EACV,KAAK,OAAO,EACb,MAAM,OAAO,CAAC;AAef;;;;GAIG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;gBAEzB,KAAK,EAAE,KAAK;IAKxB,2CAA2C;IAC3C,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,wEAAwE;IACxE,GAAG,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI;IA+B7B,uCAAuC;IACvC,KAAK,IAAI,IAAI;IAYb,OAAO,IAAI,IAAI;CAIhB"}
@@ -0,0 +1,59 @@
1
+ import { Vector3, PerspectiveCamera, Scene } from 'three';
2
+ import { Coordinates } from '@wemap/geo';
3
+ import { ViewerNode } from '../types';
4
+ /** What a click on the panorama does. */
5
+ export type ClickMode = 'navigate' | 'locate' | 'measure';
6
+ export interface PanoramaPointerCallbacks {
7
+ /** The node on screen, or null while none is (loading, mid-transition). */
8
+ current: () => ViewerNode | null;
9
+ /** Nearest other node on the same level as `to`, or null. */
10
+ nearest: (to: Coordinates) => ViewerNode | null;
11
+ /** `navigate` mode: the user clicked/tapped the floor near a node. */
12
+ select: (node: ViewerNode) => void;
13
+ /** `locate` / `measure` modes: the user clicked/tapped the panorama in this view direction. */
14
+ pick: (direction: Vector3) => void;
15
+ /** `navigate` mode: a click that walks nowhere (above the horizon, or no node there), in this view direction. */
16
+ miss: (direction: Vector3) => void;
17
+ }
18
+ /**
19
+ * Pointer interaction on the panorama. A drag that looks around is never a click.
20
+ *
21
+ * - `navigate` (walking): hovering the floor shows a disc under the
22
+ * pointer and a cross on the nearest node; clicking walks there. Off when
23
+ * `walk` is false.
24
+ * - `locate` / `measure`: a crosshair cursor; clicking reports the view
25
+ * direction, to locate or measure what is under it.
26
+ *
27
+ * Positions are in the scene frame (see `frame/SceneFrame`), with the floor
28
+ * GROUND_OFFSET below the camera.
29
+ */
30
+ export declare class PanoramaPointer {
31
+ /** What a click does. */
32
+ mode: ClickMode;
33
+ private readonly scene;
34
+ private readonly camera;
35
+ private readonly element;
36
+ private readonly callbacks;
37
+ private readonly walk;
38
+ private readonly raycaster;
39
+ private readonly floor;
40
+ private readonly pointer;
41
+ private readonly hit;
42
+ private readonly disc;
43
+ private readonly cross;
44
+ private pressedAt;
45
+ private target;
46
+ constructor(scene: Scene, camera: PerspectiveCamera, element: HTMLElement, callbacks: PanoramaPointerCallbacks, walk?: boolean);
47
+ /** Hide both markers (e.g. right after navigating, or when the mode changes). */
48
+ hide(): void;
49
+ dispose(): void;
50
+ private readonly onPointerMove;
51
+ private readonly onPointerDown;
52
+ private readonly onPointerUp;
53
+ private readonly onPointerLeave;
54
+ /** Point the raycaster from the camera through the pointer. */
55
+ private aim;
56
+ /** Refresh the hover feedback: floor disc, cross and target, or the locate cursor. */
57
+ private update;
58
+ }
59
+ //# sourceMappingURL=PanoramaPointer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanoramaPointer.d.ts","sourceRoot":"","sources":["../../../src/graph/PanoramaPointer.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,OAAO,EACP,KAAK,iBAAiB,EACtB,KAAK,KAAK,EACX,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AA8B3C,yCAAyC;AACzC,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE1D,MAAM,WAAW,wBAAwB;IACvC,2EAA2E;IAC3E,OAAO,EAAE,MAAM,UAAU,GAAG,IAAI,CAAC;IACjC,6DAA6D;IAC7D,OAAO,EAAE,CAAC,EAAE,EAAE,WAAW,KAAK,UAAU,GAAG,IAAI,CAAC;IAChD,sEAAsE;IACtE,MAAM,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACnC,+FAA+F;IAC/F,IAAI,EAAE,CAA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@@
1
+ import { Scene } from 'three';
2
+ import { ViewerNode, ViewerPolygon } from '../types';
3
+ /**
4
+ * Polygons anchored in the real world, drawn over the panorama. The scene frame is
5
+ * the shown node's, so they are placed again each time another node is shown;
6
+ * while the camera travels to the next node they stay where they are in the world.
7
+ * The panorama has no depth: a polygon behind a wall still shows.
8
+ */
9
+ export declare class PolygonOverlay {
10
+ private readonly scene;
11
+ private readonly group;
12
+ private polygons;
13
+ private origin;
14
+ constructor(scene: Scene);
15
+ set(polygons: ViewerPolygon[]): void;
16
+ /** Place the polygons in the frame of `node`; nothing to do if it already is the origin. */
17
+ placeAt(node: ViewerNode | null): void;
18
+ private build;
19
+ private clear;
20
+ dispose(): void;
21
+ }
22
+ //# sourceMappingURL=PolygonOverlay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PolygonOverlay.d.ts","sourceRoot":"","sources":["../../../src/graph/PolygonOverlay.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,KAAK,KAAK,EACX,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAyB1D;;;;;GAKG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAQ;IAC9B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,MAAM,CAA2B;gBAE7B,KAAK,EAAE,KAAK;IAKxB,GAAG,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,IAAI;IAKpC,4FAA4F;IAC5F,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,GAAG,IAAI;IAQtC,OAAO,CAAC,KAAK;IAsCb,OAAO,CAAC,KAAK;IAUb,OAAO,IAAI,IAAI;CAIhB"}
@@ -0,0 +1,50 @@
1
+ import { ShaderMaterial, Vector3, Texture } from 'three';
2
+ import { ViewerNode } from '../types';
3
+ /** Loads a node's panorama image as a texture. */
4
+ export type ImageLoader = (url: string) => Promise<Texture>;
5
+ /**
6
+ * Moves the panorama from the node on screen to another: waits for the new
7
+ * image, then fades it in while the camera travels between the two capture
8
+ * points (a plain fade across levels or long hops, a fade from black for the
9
+ * first image). Owns the panorama material and every texture it shows.
10
+ *
11
+ * Driven by the render loop: call {@link update} every frame with the current
12
+ * time and place the camera at the offset it returns.
13
+ */
14
+ export declare class PanoramaTransition {
15
+ /** The panorama material, for the viewer's inside-out sphere. */
16
+ readonly material: ShaderMaterial;
17
+ private shownNode;
18
+ private pending;
19
+ private fade;
20
+ private disposed;
21
+ private readonly cameraOffset;
22
+ private readonly loadImage;
23
+ constructor(loadImage?: ImageLoader);
24
+ /** The node whose image is fully on screen: where the next transition starts from. */
25
+ get shown(): ViewerNode | null;
26
+ /** Pixel size of the shown node's image, or null before the first one is on screen. */
27
+ get shownImageSize(): {
28
+ width: number;
29
+ height: number;
30
+ } | null;
31
+ /** True while a requested node is loading or fading in. */
32
+ get busy(): boolean;
33
+ /**
34
+ * Go to a node. Resolves true once its image has loaded and the transition has
35
+ * started; false if a later {@link show} (or {@link dispose}) overtook it.
36
+ * Rejects if the image fails to load; the shown node then stays on screen.
37
+ * A transition still running when the new image arrives jumps to its end.
38
+ */
39
+ show(node: ViewerNode): Promise<boolean>;
40
+ /**
41
+ * Advance to `now` (ms, any monotonic clock). Returns where the camera sits,
42
+ * in the frame of the shown node: zero at rest.
43
+ */
44
+ update(now: number): Vector3;
45
+ /** Free the material and every texture, including images still loading. */
46
+ dispose(): void;
47
+ /** End the running fade: the incoming image becomes the shown one. */
48
+ private settle;
49
+ }
50
+ //# sourceMappingURL=PanoramaTransition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanoramaTransition.d.ts","sourceRoot":"","sources":["../../../src/transition/PanoramaTransition.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,cAAc,EAEd,OAAO,EACP,KAAK,OAAO,EACb,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAQ3C,kDAAkD;AAClD,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AA8E5D;;;;;;;;GAQG;AACH,qBAAa,kBAAkB;IAC7B,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,iBAAoB;IAErC,OAAO,CAAC,SAAS,CAA2B;IAC5C,OAAO,CAAC,OAAO,CAA2B;IAC1C,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAiB;IAC9C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;gBAE5B,SAAS,GAAE,WAA2B;IAIlD,sFAAsF;IACtF,IAAI,KAAK,IAAI,UAAU,GAAG,IAAI,CAE7B;IAED,uFAAuF;IACvF,IAAI,cAAc,IAAI;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAK7D;IAED,2DAA2D;IAC3D,IAAI,IAAI,IAAI,OAAO,CAElB;IAED;;;;;OAKG;IACG,IAAI,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC;IA2C9C;;;OAGG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAgB5B,2EAA2E;IAC3E,OAAO,IAAI,IAAI;IAYf,sEAAsE;IACtE,OAAO,CAAC,MAAM;CAef"}
@@ -0,0 +1,11 @@
1
+ import { Group } from '@tweenjs/tween.js';
2
+ /**
3
+ * Shared tween group for the viewer: a tween.js Group that the render loop
4
+ * ticks each frame via {@link WemapViewer}.
5
+ *
6
+ * `SphereControls` and `WemapViewer.lookAt` add their tweens here; whoever
7
+ * added them removes them on complete. (The panorama transition runs on the
8
+ * render loop's clock instead.)
9
+ */
10
+ export declare const tweenGroup: Group;
11
+ //# sourceMappingURL=tweens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tweens.d.ts","sourceRoot":"","sources":["../../src/tweens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE1C;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,OAAc,CAAC"}
@@ -0,0 +1,147 @@
1
+ import { Coordinates } from '@wemap/geo';
2
+ /**
3
+ * A single node in the 360° image graph: one panorama image at a geo position,
4
+ * with the edges (transitions) to neighbouring nodes.
5
+ */
6
+ export interface ViewerNode {
7
+ /** Keyframe id — unique within the graph. */
8
+ id: number;
9
+ /** Geo position of the capture point. */
10
+ coordinates: Coordinates;
11
+ /** Indoor level (0 = ground). */
12
+ level: number;
13
+ /** Absolute URL of the equirectangular image. */
14
+ image: string;
15
+ /** Capture heading in degrees, used to align the panorama to north. */
16
+ heading: number;
17
+ }
18
+ /**
19
+ * Behaviour options for a {@link WemapViewer}. Identity (emmid), auth and the
20
+ * VPS endpoint are NOT here — they come from `@wemap/core` (`core.init()`).
21
+ */
22
+ export interface ViewerOptions {
23
+ /** Enable mouse-wheel zoom. Defaults to true. */
24
+ zoom?: boolean;
25
+ /** Widest vertical field of view the wheel zooms out to, in degrees. Defaults to 80. */
26
+ maxFov?: number;
27
+ /**
28
+ * In-panorama navigation: hovering the floor shows a disc and a
29
+ * cross on the nearest node; clicking walks there. Defaults to true.
30
+ */
31
+ navigation?: boolean;
32
+ /**
33
+ * Fired as soon as a move to a node starts (programmatically or by click), and
34
+ * again with the node still on screen if the new image fails to load.
35
+ */
36
+ onNavigate?: (nodeId: number) => void;
37
+ /** Fired when look heading changes (degrees), e.g. to sync a compass. */
38
+ onHeadingChange?: (heading: number) => void;
39
+ /** Fired once, when the first image is on screen. */
40
+ onReady?: () => void;
41
+ /** Fired with the position under a click, in `locate` click mode. */
42
+ onLocate?: (point: LocatedPoint) => void;
43
+ /** Fired with the distance between two clicks, in `measure` click mode. */
44
+ onMeasure?: (measurement: Measurement) => void;
45
+ /** Fired with the view direction of a click that walks nowhere, in `navigate` mode. */
46
+ onClick?: (click: ViewerClick) => void;
47
+ /** Fired when the graph, an image, a located point or a measurement fails to load. */
48
+ onError?: (error: Error) => void;
49
+ }
50
+ /** The distance between two clicked points in `measure` mode, from the VPS depth estimate. */
51
+ export interface Measurement {
52
+ /** Distance in metres. */
53
+ distance: number;
54
+ /** The node whose image was clicked. */
55
+ node: ViewerNode;
56
+ }
57
+ /**
58
+ * A click on the panorama that walked nowhere: what the user pointed at, as a
59
+ * direction from the node on screen. Cast it against your own geometry to pick
60
+ * what is there (a shelf, a door).
61
+ */
62
+ export interface ViewerClick {
63
+ /** Compass heading of the direction, degrees (0 = north, 90 = east). */
64
+ heading: number;
65
+ /** Pitch of the direction, degrees, positive up. */
66
+ pitch: number;
67
+ /** The node the direction starts from. */
68
+ node: ViewerNode;
69
+ }
70
+ /** What is under a click in `locate` mode, from the VPS depth estimate. */
71
+ export interface LocatedPoint {
72
+ /** Geo position, with altitude and level (the node's when the VPS gives none). */
73
+ coordinates: Coordinates;
74
+ /** The node whose image was clicked. */
75
+ node: ViewerNode;
76
+ }
77
+ /**
78
+ * A polygon anchored in the real world, drawn over the panorama: an area on the
79
+ * floor, a shelf front, a door. See {@link WemapViewer.setPolygons}.
80
+ */
81
+ export interface ViewerPolygon {
82
+ /** Vertices in order, not closed. Each needs an altitude, in the same reference as the graph nodes'. */
83
+ coordinates: Coordinates[];
84
+ /** Fill colour (CSS). Defaults to Wemap blue. */
85
+ color?: string;
86
+ /** Fill opacity, 0 to 1. Defaults to 0.25. */
87
+ fillOpacity?: number;
88
+ /** Outline colour (CSS). Defaults to `color`. */
89
+ outlineColor?: string;
90
+ }
91
+ /** Where {@link WemapViewer.open} makes the user look, in degrees. */
92
+ export interface OpenOptions {
93
+ /** Look heading, 0 = north, 90 = east. Omit to keep the current look direction. */
94
+ heading?: number;
95
+ /** Look pitch, positive up. Defaults to 0 when `heading` is given. */
96
+ pitch?: number;
97
+ }
98
+ export interface VisionGraph {
99
+ images: Array<{
100
+ filename: string;
101
+ id: number;
102
+ coords: {
103
+ lat: number;
104
+ lng: number;
105
+ level: number;
106
+ alt?: number | null;
107
+ };
108
+ heading: number;
109
+ }>;
110
+ edges: Array<{
111
+ keyframeId1: number;
112
+ keyframeId2: number;
113
+ weight: number;
114
+ level: number | number[];
115
+ }>;
116
+ }
117
+ export interface GraphPoint {
118
+ type: 'Feature';
119
+ id: number;
120
+ properties: {
121
+ id: number;
122
+ level: number;
123
+ heading: number;
124
+ };
125
+ geometry: {
126
+ type: 'Point';
127
+ coordinates: [number, number];
128
+ };
129
+ }
130
+ export interface GraphLine {
131
+ type: 'Feature';
132
+ properties: {
133
+ keyframeId1: number;
134
+ keyframeId2: number;
135
+ weight: number;
136
+ level: number | [number, number];
137
+ };
138
+ geometry: {
139
+ type: 'LineString';
140
+ coordinates: [[number, number], [number, number]];
141
+ };
142
+ }
143
+ export interface VisionGeojsonGraph {
144
+ type: 'FeatureCollection';
145
+ features: Array<GraphLine | GraphPoint>;
146
+ }
147
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,6CAA6C;IAC7C,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,WAAW,EAAE,WAAW,CAAC;IACzB,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,iDAAiD;IACjD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,wFAAwF;IACxF,MAAM,CAAC,EAAE,MAAM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AK,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KAClC,CAAC;IACF,QAAQ,EAAE;QAAE,IAAI,EAAE,YAAY,CAAC;QAAC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;KAAE,CAAC;CACrF;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,GAAG,UAAU,CAAC,CAAC;CACzC"}
package/dist/style.css ADDED
@@ -0,0 +1,2 @@
1
+ .wemap-viewer__canvas{touch-action:none;-webkit-user-select:none;user-select:none;cursor:grab;width:100%;height:100%;display:block}.wemap-viewer__canvas:active{cursor:grabbing}.wemap-viewer__canvas:focus:not(:focus-visible){outline:none}
2
+ /*$vite$:1*/