@soonspacejs/plugin-tiles 2.14.35 → 2.14.37
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/index.esm.js +16 -18
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import ee from "soonspacejs";
|
|
|
2
2
|
import { TilesRenderer as R } from "um-3d-tiles-renderer";
|
|
3
3
|
import { GLTFLoader as pe } from "three/examples/jsm/loaders/GLTFLoader.js";
|
|
4
4
|
import { MathUtils as C, MeshBasicMaterial as Me, Color as z, Vector3 as _e, Box3 as Oe, Sphere as Te, MeshStandardMaterial as we, ShaderMaterial as ue } from "three";
|
|
5
|
-
import { TilesFadePlugin as te, UpdateOnChangePlugin as se, QuantizedMeshPlugin as q, ImageOverlayPlugin as me, XYZTilesOverlay as ye, ReorientationPlugin as re, GeoJSONOverlay as Pe, CesiumIonOverlay as Se, TMSTilesOverlay as Ce, UrlTemplateTilesOverlay as Le, WMSTilesOverlay as Ee, WMTSCapabilitiesLoader as
|
|
5
|
+
import { TilesFadePlugin as te, UpdateOnChangePlugin as se, QuantizedMeshPlugin as q, ImageOverlayPlugin as me, XYZTilesOverlay as ye, ReorientationPlugin as re, GeoJSONOverlay as Pe, CesiumIonOverlay as Se, TMSTilesOverlay as Ce, UrlTemplateTilesOverlay as Le, WMSTilesOverlay as Ee, WMTSCapabilitiesLoader as Ie, WMTSTilesOverlay as be, CesiumIonAuthPlugin as fe } from "um-3d-tiles-renderer/plugins";
|
|
6
6
|
import { PlotOverlay as Re } from "um-3d-tiles-renderer/three/plugins";
|
|
7
7
|
class xe {
|
|
8
8
|
constructor(e) {
|
|
@@ -400,12 +400,12 @@ class Ae {
|
|
|
400
400
|
if (!this.imageOverlayPlugin) return null;
|
|
401
401
|
if (this._instances.has(e.id))
|
|
402
402
|
return console.warn(`OverlayManager: Overlay "${e.id}" already exists`), null;
|
|
403
|
-
const t = await new
|
|
403
|
+
const t = await new Ie().loadAsync(e.url), s = ["EPSG:4326", "EPSG:3857"];
|
|
404
404
|
let r = e.layer || "";
|
|
405
405
|
t.layers.find((n) => n.identifier === r) || (r = t.layers.find(
|
|
406
406
|
(n) => n?.tileMatrixSets?.some((o) => s.includes(o.supportedCRS))
|
|
407
407
|
)?.identifier || t.layers[0].identifier);
|
|
408
|
-
const a = new
|
|
408
|
+
const a = new be({
|
|
409
409
|
capabilities: t,
|
|
410
410
|
layer: r,
|
|
411
411
|
dimensions: e.dimensions || null,
|
|
@@ -574,9 +574,7 @@ class Ae {
|
|
|
574
574
|
* 只清理实例(保留 ResourceManager 中的配置)
|
|
575
575
|
*/
|
|
576
576
|
disposeInstances() {
|
|
577
|
-
console.log("disposeInstances"), console.log(this._instances)
|
|
578
|
-
debugger;
|
|
579
|
-
this._instances.forEach((e) => {
|
|
577
|
+
console.log("disposeInstances"), console.log(this._instances), this._instances.forEach((e) => {
|
|
580
578
|
this.imageOverlayPlugin?.deleteOverlay(e.instance);
|
|
581
579
|
}), this._instances.clear();
|
|
582
580
|
}
|
|
@@ -1003,8 +1001,8 @@ function qe(i) {
|
|
|
1003
1001
|
let p = 0;
|
|
1004
1002
|
const f = s - c;
|
|
1005
1003
|
for (let v = 0; v < t.length && (v > 0 && (p += T(t[v - 1], t[v])), !(p > f)); v++) {
|
|
1006
|
-
const H = f > 0 ? p / f : 0, D = d * (1 - H * 0.5), N = v > 0 ? t[v - 1] : t[0], W = v < t.length - 1 ? t[v + 1] : t[v], A = W[0] - N[0], E = W[1] - N[1], F = Math.sqrt(A * A + E * E) || 1, G = -E / F,
|
|
1007
|
-
g.push([t[v][0] + G * D, t[v][1] +
|
|
1004
|
+
const H = f > 0 ? p / f : 0, D = d * (1 - H * 0.5), N = v > 0 ? t[v - 1] : t[0], W = v < t.length - 1 ? t[v + 1] : t[v], A = W[0] - N[0], E = W[1] - N[1], F = Math.sqrt(A * A + E * E) || 1, G = -E / F, I = A / F;
|
|
1005
|
+
g.push([t[v][0] + G * D, t[v][1] + I * D]), m.push([t[v][0] - G * D, t[v][1] - I * D]);
|
|
1008
1006
|
}
|
|
1009
1007
|
const M = t[t.length - 1], _ = t[t.length - 2], w = s * a, P = s * n, L = y(_, M, h, w, !1), x = y(_, M, h, w, !0), k = y(_, M, o, P, !1), j = y(_, M, o, P, !0);
|
|
1010
1008
|
return [...g, L, k, M, j, x, ...m.reverse()];
|
|
@@ -1029,8 +1027,8 @@ function Ze(i) {
|
|
|
1029
1027
|
const de = (N / 2 - E / H * A) / Math.sin(J);
|
|
1030
1028
|
F.push(y(r[O - 1], r[O], Math.PI - J, de, !0)), G.push(y(r[O - 1], r[O], J, de, !1));
|
|
1031
1029
|
}
|
|
1032
|
-
let
|
|
1033
|
-
return
|
|
1030
|
+
let I = [e, ...F, x], B = [t, ...G, k];
|
|
1031
|
+
return I = K(ge(I), 25), B = K(ge(B), 25), [...I, ...j, ...B.reverse()];
|
|
1034
1032
|
}
|
|
1035
1033
|
class Ve extends S {
|
|
1036
1034
|
category = "arrow";
|
|
@@ -1678,7 +1676,7 @@ class yt {
|
|
|
1678
1676
|
), this.loedTilesSets.clear(), this.tiles.removeEventListener("needs-render", this.render), this.tiles.removeEventListener("needs-update", this.render), this.tiles.dispose();
|
|
1679
1677
|
}
|
|
1680
1678
|
}
|
|
1681
|
-
const
|
|
1679
|
+
const b = {
|
|
1682
1680
|
DEFAULT: 0,
|
|
1683
1681
|
GRADIENT: 1,
|
|
1684
1682
|
TOPOGRAPHIC_LINES: 2,
|
|
@@ -1769,7 +1767,7 @@ class nt {
|
|
|
1769
1767
|
_box = new Oe();
|
|
1770
1768
|
_sphere = new Te();
|
|
1771
1769
|
// 当前材质类型
|
|
1772
|
-
_materialType =
|
|
1770
|
+
_materialType = b.DEFAULT;
|
|
1773
1771
|
// 按需渲染标志
|
|
1774
1772
|
_needsUpdate = !0;
|
|
1775
1773
|
_cameraTransitionStart = !1;
|
|
@@ -1852,7 +1850,7 @@ class nt {
|
|
|
1852
1850
|
onLoadModel = ({ scene: e }) => {
|
|
1853
1851
|
e.traverse((t) => {
|
|
1854
1852
|
t.isMesh && (t.originalMaterial = t.material);
|
|
1855
|
-
}), this._materialType !==
|
|
1853
|
+
}), this._materialType !== b.DEFAULT && this.updateMaterial(e);
|
|
1856
1854
|
};
|
|
1857
1855
|
/**
|
|
1858
1856
|
* 更新场景中所有网格的材质(参考 customMaterial.js)
|
|
@@ -1862,18 +1860,18 @@ class nt {
|
|
|
1862
1860
|
e.traverse((s) => {
|
|
1863
1861
|
if (s.isMesh)
|
|
1864
1862
|
switch (s.material && s.material !== s.originalMaterial && s.material.dispose(), t) {
|
|
1865
|
-
case
|
|
1863
|
+
case b.DEFAULT:
|
|
1866
1864
|
s.material = s.originalMaterial, s.material && (s.material.side = 2), s.receiveShadow = !1, s.castShadow = !1;
|
|
1867
1865
|
break;
|
|
1868
|
-
case
|
|
1866
|
+
case b.GRADIENT:
|
|
1869
1867
|
s.material = new ue(it), s.material.side = 2, s.receiveShadow = !1, s.castShadow = !1;
|
|
1870
1868
|
break;
|
|
1871
|
-
case
|
|
1869
|
+
case b.TOPOGRAPHIC_LINES: {
|
|
1872
1870
|
const r = new ue(at);
|
|
1873
1871
|
r.extensions = { derivatives: !0 }, r.side = 2, s.material = r, s.receiveShadow = !1, s.castShadow = !1;
|
|
1874
1872
|
break;
|
|
1875
1873
|
}
|
|
1876
|
-
case
|
|
1874
|
+
case b.LIGHTING:
|
|
1877
1875
|
s.material = new we(), s.material.side = 2, s.receiveShadow = !0, s.castShadow = !0;
|
|
1878
1876
|
break;
|
|
1879
1877
|
}
|
|
@@ -2040,7 +2038,7 @@ export {
|
|
|
2040
2038
|
Be as GisPlotSector,
|
|
2041
2039
|
Ke as GisPlotText,
|
|
2042
2040
|
tt as GroundDecalManager,
|
|
2043
|
-
|
|
2041
|
+
b as MaterialType,
|
|
2044
2042
|
Ae as OverlayManager,
|
|
2045
2043
|
l as OverlayType,
|
|
2046
2044
|
yt as TerrainTilesRenderer,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soonspacejs/plugin-tiles",
|
|
3
3
|
"pluginName": "TilesPlugin",
|
|
4
|
-
"version": "2.14.
|
|
4
|
+
"version": "2.14.37",
|
|
5
5
|
"description": "3D Tiles plugin for SoonSpace.js",
|
|
6
6
|
"main": "dist/index.esm.js",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"um-3d-tiles-renderer": "^0.4.31",
|
|
22
22
|
"three": "^0.183.0",
|
|
23
|
-
"soonspacejs": "2.14.
|
|
23
|
+
"soonspacejs": "2.14.37"
|
|
24
24
|
}
|
|
25
25
|
}
|