@mapvx/web-js 3.5.0-dev.2 → 3.5.0-dev.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.
- package/dist/cjs/controllers/routeController.js +396 -106
- package/dist/cjs/controllers/routeController.js.map +1 -1
- package/dist/cjs/domain/models/routeInstance.js +1 -0
- package/dist/cjs/domain/models/routeInstance.js.map +1 -1
- package/dist/cjs/logger/sentry.js +1 -1
- package/dist/cjs/map/map.js +250 -24
- package/dist/cjs/map/map.js.map +1 -1
- package/dist/cjs/map/mapInteractionOptions.js +18 -0
- package/dist/cjs/map/mapInteractionOptions.js.map +1 -1
- package/dist/cjs/utils/loadGlb.js +55 -20
- package/dist/cjs/utils/loadGlb.js.map +1 -1
- package/dist/cjs/utils/three.js +70 -34
- package/dist/cjs/utils/three.js.map +1 -1
- package/dist/es/controllers/routeController.d.ts +91 -13
- package/dist/es/controllers/routeController.d.ts.map +1 -1
- package/dist/es/controllers/routeController.js +396 -106
- package/dist/es/controllers/routeController.js.map +1 -1
- package/dist/es/domain/models/mapConfig.d.ts +76 -0
- package/dist/es/domain/models/mapConfig.d.ts.map +1 -1
- package/dist/es/domain/models/routeInstance.d.ts +70 -1
- package/dist/es/domain/models/routeInstance.d.ts.map +1 -1
- package/dist/es/domain/models/routeInstance.js +1 -0
- package/dist/es/domain/models/routeInstance.js.map +1 -1
- package/dist/es/logger/sentry.js +1 -1
- package/dist/es/map/map.d.ts +76 -0
- package/dist/es/map/map.d.ts.map +1 -1
- package/dist/es/map/map.js +250 -24
- package/dist/es/map/map.js.map +1 -1
- package/dist/es/map/mapInteractionOptions.d.ts +5 -1
- package/dist/es/map/mapInteractionOptions.d.ts.map +1 -1
- package/dist/es/map/mapInteractionOptions.js +18 -0
- package/dist/es/map/mapInteractionOptions.js.map +1 -1
- package/dist/es/utils/loadGlb.d.ts +41 -0
- package/dist/es/utils/loadGlb.d.ts.map +1 -1
- package/dist/es/utils/loadGlb.js +55 -21
- package/dist/es/utils/loadGlb.js.map +1 -1
- package/dist/es/utils/three.d.ts +37 -8
- package/dist/es/utils/three.d.ts.map +1 -1
- package/dist/es/utils/three.js +68 -32
- package/dist/es/utils/three.js.map +1 -1
- package/dist/umd/index.js +1012 -257
- package/dist/umd/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadGlb.js","sourceRoot":"","sources":["../../../src/utils/loadGlb.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"loadGlb.js","sourceRoot":"","sources":["../../../src/utils/loadGlb.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,4BAA4B,EAAE,MAAM,iBAAiB,CAAA;AAC1F,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAwBtE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAA6C,kBAAkB;IAE/D,OAAO;QACL,sEAAsE;QACtE,SAAS,EAAE,OAAO,WAAW,KAAK,QAAQ;QAC1C,qBAAqB,EAAE,KAAK,EAC1B,KAAa,EACb,IAAY,EACZ,MAAkB,EAClB,IAAY,EACZ,MAAe,EACf,EAAE;YACF,MAAM,OAAO,GAAG,MAAM,IAAI,EAAE,CAAA;YAC5B,MAAM,OAAO,CAAC,KAAK,CAAA;YACnB,OAAO,OAAO,CAAC,qBAAqB,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;QACzE,CAAC;KACF,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,aAAa,GAAG,aAAa,CAAC,GAAG,EAAE,CACvC,SAAS,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;IACvB,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,WAAW,EAAE,CAAA;IACzC,WAAW,CAAC,cAAc,CAAC,0BA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ils/three.d.ts
CHANGED
|
@@ -31,12 +31,6 @@ export interface ThreeModule {
|
|
|
31
31
|
GLTFLoader: typeof GLTFLoader;
|
|
32
32
|
DRACOLoader: typeof DRACOLoader;
|
|
33
33
|
KTX2Loader: typeof KTX2Loader;
|
|
34
|
-
/**
|
|
35
|
-
* The singleton meshopt decoder. Wired into the GLB loader so assets compressed with
|
|
36
|
-
* `EXT_meshopt_compression` (a much stronger geometry/vertex compressor than Draco for many
|
|
37
|
-
* meshes) decode instead of failing. See {@link getGltfLoader} in `loadGlb.ts`.
|
|
38
|
-
*/
|
|
39
|
-
MeshoptDecoder: typeof MeshoptDecoder;
|
|
40
34
|
}
|
|
41
35
|
/** Runtime handle to the deck.gl classes used by the 3D scene. */
|
|
42
36
|
export interface DeckModule {
|
|
@@ -46,13 +40,48 @@ export interface DeckModule {
|
|
|
46
40
|
PathLayer: typeof import("@deck.gl/layers").PathLayer;
|
|
47
41
|
TextLayer: typeof import("@deck.gl/layers").TextLayer;
|
|
48
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Memoizes a dynamic-import chain, caching only a FULFILLED result.
|
|
45
|
+
*
|
|
46
|
+
* A plain `cached ??= import(...)` also memoizes a *rejection*, so one transient chunk-fetch
|
|
47
|
+
* failure (a dropped connection, a cache-busted deploy mid-session) permanently disables the
|
|
48
|
+
* feature for the rest of the page's life: every retry receives the same rejected promise and
|
|
49
|
+
* fails identically. The 3D scene retries on its own — `reloadScene3DModelsForLod` reloads GLB
|
|
50
|
+
* templates on every zoom-in past the LOD threshold — so a sticky rejection turns a blip into
|
|
51
|
+
* models that never come back until the user reloads.
|
|
52
|
+
*
|
|
53
|
+
* Concurrent callers still share one in-flight import (that is the point of the cache); only the
|
|
54
|
+
* rejected promise is evicted, and the error is re-thrown so every current caller still sees it.
|
|
55
|
+
*
|
|
56
|
+
* Exported only so the eviction behaviour can be tested directly — the loaders below wrap real
|
|
57
|
+
* dynamic `import()` calls, which a unit test cannot fail on demand.
|
|
58
|
+
*
|
|
59
|
+
* @param load Builds the import promise. Called again on the first retry after a failure.
|
|
60
|
+
* @returns An accessor that imports at most once per successful load.
|
|
61
|
+
* @internal
|
|
62
|
+
*/
|
|
63
|
+
export declare function memoizeImport<T>(load: () => Promise<T>): () => Promise<T>;
|
|
49
64
|
/**
|
|
50
65
|
* Dynamically imports Three.js and the GLTF/DRACO/KTX2 loaders once and caches the result.
|
|
51
66
|
* Subsequent calls return the same promise, so a single Three.js instance is shared.
|
|
67
|
+
* A failed import is not cached — see {@link memoizeImport}.
|
|
68
|
+
*/
|
|
69
|
+
export declare const loadThree: () => Promise<ThreeModule>;
|
|
70
|
+
/**
|
|
71
|
+
* Dynamically imports the singleton meshopt decoder once and caches the result.
|
|
72
|
+
*
|
|
73
|
+
* Deliberately NOT part of {@link loadThree}'s import chain: only GLBs compressed with
|
|
74
|
+
* `EXT_meshopt_compression` need it, so keeping it out of the eager `Promise.all` keeps the
|
|
75
|
+
* decoder module (and its WASM instantiation) off the critical path of the first 3D frame.
|
|
76
|
+
* It is fetched on the first meshopt buffer decode instead — see the lazy wrapper in
|
|
77
|
+
* `loadGlb.ts`. That moves the fetch inside `parse()`, competing with hundreds of MB of GLB
|
|
78
|
+
* downloads, so not caching a failed import (see {@link memoizeImport}) matters more here than
|
|
79
|
+
* for the eager loaders.
|
|
52
80
|
*/
|
|
53
|
-
export declare
|
|
81
|
+
export declare const loadMeshoptDecoder: () => Promise<typeof MeshoptDecoder>;
|
|
54
82
|
/**
|
|
55
83
|
* Dynamically imports the deck.gl overlay and layer classes once and caches the result.
|
|
84
|
+
* A failed import is not cached — see {@link memoizeImport}.
|
|
56
85
|
*/
|
|
57
|
-
export declare
|
|
86
|
+
export declare const loadDeck: () => Promise<DeckModule>;
|
|
58
87
|
//# sourceMappingURL=three.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"three.d.ts","sourceRoot":"","sources":["../../../src/utils/three.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;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ACrD,SAAS,EAAE,cAAc,iBAAiB,EAAE,SAAS,CAAA;CACtD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,MAAM,OAAO,CAAC,CAAC,CAAC,CAWzE;AAED;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,MAAM,OAAO,CAAC,WAAW,CAYhD,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,OAAO,CAAC,OAAO,cAAc,CAEnE,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,OAAO,CAAC,UAAU,CAY9C,CAAA"}
|
package/dist/es/utils/three.js
CHANGED
|
@@ -1,40 +1,76 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Memoizes a dynamic-import chain, caching only a FULFILLED result.
|
|
3
|
+
*
|
|
4
|
+
* A plain `cached ??= import(...)` also memoizes a *rejection*, so one transient chunk-fetch
|
|
5
|
+
* failure (a dropped connection, a cache-busted deploy mid-session) permanently disables the
|
|
6
|
+
* feature for the rest of the page's life: every retry receives the same rejected promise and
|
|
7
|
+
* fails identically. The 3D scene retries on its own — `reloadScene3DModelsForLod` reloads GLB
|
|
8
|
+
* templates on every zoom-in past the LOD threshold — so a sticky rejection turns a blip into
|
|
9
|
+
* models that never come back until the user reloads.
|
|
10
|
+
*
|
|
11
|
+
* Concurrent callers still share one in-flight import (that is the point of the cache); only the
|
|
12
|
+
* rejected promise is evicted, and the error is re-thrown so every current caller still sees it.
|
|
13
|
+
*
|
|
14
|
+
* Exported only so the eviction behaviour can be tested directly — the loaders below wrap real
|
|
15
|
+
* dynamic `import()` calls, which a unit test cannot fail on demand.
|
|
16
|
+
*
|
|
17
|
+
* @param load Builds the import promise. Called again on the first retry after a failure.
|
|
18
|
+
* @returns An accessor that imports at most once per successful load.
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export function memoizeImport(load) {
|
|
22
|
+
let cached;
|
|
23
|
+
return () => {
|
|
24
|
+
cached !== null && cached !== void 0 ? cached : (cached = load().catch((error) => {
|
|
25
|
+
// Evict BEFORE re-throwing so the next call starts a fresh import. Safe to assign here:
|
|
26
|
+
// a promise never settles synchronously, so `cached` is already assigned by now.
|
|
27
|
+
cached = undefined;
|
|
28
|
+
throw error;
|
|
29
|
+
}));
|
|
30
|
+
return cached;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
3
33
|
/**
|
|
4
34
|
* Dynamically imports Three.js and the GLTF/DRACO/KTX2 loaders once and caches the result.
|
|
5
35
|
* Subsequent calls return the same promise, so a single Three.js instance is shared.
|
|
36
|
+
* A failed import is not cached — see {@link memoizeImport}.
|
|
6
37
|
*/
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
38
|
+
export const loadThree = memoizeImport(() => Promise.all([
|
|
39
|
+
import("three"),
|
|
40
|
+
import("three/addons/loaders/GLTFLoader.js"),
|
|
41
|
+
import("three/addons/loaders/DRACOLoader.js"),
|
|
42
|
+
import("three/addons/loaders/KTX2Loader.js"),
|
|
43
|
+
]).then(([three, gltf, draco, ktx2]) => ({
|
|
44
|
+
THREE: three,
|
|
45
|
+
GLTFLoader: gltf.GLTFLoader,
|
|
46
|
+
DRACOLoader: draco.DRACOLoader,
|
|
47
|
+
KTX2Loader: ktx2.KTX2Loader,
|
|
48
|
+
})));
|
|
49
|
+
/**
|
|
50
|
+
* Dynamically imports the singleton meshopt decoder once and caches the result.
|
|
51
|
+
*
|
|
52
|
+
* Deliberately NOT part of {@link loadThree}'s import chain: only GLBs compressed with
|
|
53
|
+
* `EXT_meshopt_compression` need it, so keeping it out of the eager `Promise.all` keeps the
|
|
54
|
+
* decoder module (and its WASM instantiation) off the critical path of the first 3D frame.
|
|
55
|
+
* It is fetched on the first meshopt buffer decode instead — see the lazy wrapper in
|
|
56
|
+
* `loadGlb.ts`. That moves the fetch inside `parse()`, competing with hundreds of MB of GLB
|
|
57
|
+
* downloads, so not caching a failed import (see {@link memoizeImport}) matters more here than
|
|
58
|
+
* for the eager loaders.
|
|
59
|
+
*/
|
|
60
|
+
export const loadMeshoptDecoder = memoizeImport(() => import("three/addons/libs/meshopt_decoder.module.js").then((meshopt) => meshopt.MeshoptDecoder));
|
|
23
61
|
/**
|
|
24
62
|
* Dynamically imports the deck.gl overlay and layer classes once and caches the result.
|
|
63
|
+
* A failed import is not cached — see {@link memoizeImport}.
|
|
25
64
|
*/
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
})));
|
|
38
|
-
return deckPromise;
|
|
39
|
-
}
|
|
65
|
+
export const loadDeck = memoizeImport(() => Promise.all([
|
|
66
|
+
import("@deck.gl/mapbox"),
|
|
67
|
+
import("@deck.gl/geo-layers"),
|
|
68
|
+
import("@deck.gl/layers"),
|
|
69
|
+
]).then(([mapbox, geoLayers, layers]) => ({
|
|
70
|
+
MapboxOverlay: mapbox.MapboxOverlay,
|
|
71
|
+
MVTLayer: geoLayers.MVTLayer,
|
|
72
|
+
IconLayer: layers.IconLayer,
|
|
73
|
+
PathLayer: layers.PathLayer,
|
|
74
|
+
TextLayer: layers.TextLayer,
|
|
75
|
+
})));
|
|
40
76
|
//# sourceMappingURL=three.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"three.js","sourceRoot":"","sources":["../../../src/utils/three.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"three.js","sourceRoot":"","sources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