vis-core 0.21.28 → 0.21.29
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.js +2 -2
- package/dist/index.module.js +41 -28
- package/dist/version.d.ts +1 -1
- package/dist/vis/base/index.d.ts +7 -0
- package/dist/vis/city/index.d.ts +0 -2
- package/package.json +1 -1
package/dist/index.module.js
CHANGED
|
@@ -48310,7 +48310,7 @@ function createAreaLightMaterial(ct) {
|
|
|
48310
48310
|
const e = new MeshBasicMaterial();
|
|
48311
48311
|
return e.color.setScalar(ct), e;
|
|
48312
48312
|
}
|
|
48313
|
-
const version = "0.21.
|
|
48313
|
+
const version = "0.21.29";
|
|
48314
48314
|
class Event {
|
|
48315
48315
|
constructor() {
|
|
48316
48316
|
J0(this, "event", new EventEmitter());
|
|
@@ -49840,6 +49840,32 @@ class Base extends Event {
|
|
|
49840
49840
|
this.pencil.controls.smoothTime = Wt / 1e3, this.pencil.controls.restThreshold = 0, yield this.pencil.controls.truck(c, st, Zt), this.pencil.controls.restThreshold = 25e-4, this.pencil.controls.smoothTime = 250 / 1e3;
|
|
49841
49841
|
});
|
|
49842
49842
|
}
|
|
49843
|
+
absoluteAngle(c, st) {
|
|
49844
|
+
const Zt = Math.PI * 2, Wt = c - st;
|
|
49845
|
+
return MathUtils.euclideanModulo(Wt + Math.PI, Zt) - Math.PI;
|
|
49846
|
+
}
|
|
49847
|
+
lookAtTarget(c, st = !1, Zt = 250) {
|
|
49848
|
+
return ni(this, null, function* () {
|
|
49849
|
+
this.pencil.controls.smoothTime = Zt / 1e3;
|
|
49850
|
+
const Wt = this.pencil.controls.azimuthAngle, Yt = this.pencil.controls.polarAngle, vt = this.pencil.controls.distance, Tt = this.pencil.cameraTarget.clone(), Jt = c.azimuthAngle || Wt, $t = c.polarAngle || Yt, de = c.distance || vt, Xe = c.target || Tt, Ke = Wt !== Jt || Yt !== $t, Qe = vt !== de, qe = !Xe.equals(Tt);
|
|
49851
|
+
yield Promise.all(
|
|
49852
|
+
[
|
|
49853
|
+
qe && this.pencil.controls.setTarget(
|
|
49854
|
+
Xe.x,
|
|
49855
|
+
Xe.y,
|
|
49856
|
+
Xe.z,
|
|
49857
|
+
st
|
|
49858
|
+
),
|
|
49859
|
+
Qe && this.pencil.controls.dollyTo(de, st),
|
|
49860
|
+
Ke && this.pencil.controls.rotate(
|
|
49861
|
+
this.absoluteAngle(Jt, Wt),
|
|
49862
|
+
this.absoluteAngle($t, Yt),
|
|
49863
|
+
st
|
|
49864
|
+
)
|
|
49865
|
+
].filter(Boolean)
|
|
49866
|
+
), this.pencil.controls.smoothTime = 250 / 1e3;
|
|
49867
|
+
});
|
|
49868
|
+
}
|
|
49843
49869
|
resetCamera(c = !1, st = 250) {
|
|
49844
49870
|
return ni(this, null, function* () {
|
|
49845
49871
|
this.pencil.controls.smoothTime = st / 1e3, yield this.pencil.controls.reset(c), this.pencil.controls.smoothTime = 250 / 1e3;
|
|
@@ -53661,33 +53687,17 @@ class City$1 extends Base {
|
|
|
53661
53687
|
}
|
|
53662
53688
|
const Wt = Zt.object3d.getWorldPosition(new Vector3());
|
|
53663
53689
|
yield this.lookAtTarget(
|
|
53664
|
-
|
|
53665
|
-
|
|
53666
|
-
|
|
53690
|
+
{
|
|
53691
|
+
target: Wt,
|
|
53692
|
+
distance: 6.984429017840711 * this.multiplyScalar,
|
|
53693
|
+
polarAngle: 0.9963693538268685,
|
|
53694
|
+
azimuthAngle: 0
|
|
53695
|
+
},
|
|
53696
|
+
!0
|
|
53667
53697
|
);
|
|
53668
53698
|
}
|
|
53669
53699
|
});
|
|
53670
53700
|
}
|
|
53671
|
-
absoluteAngle(c, st) {
|
|
53672
|
-
const Zt = Math.PI * 2, Wt = c - st;
|
|
53673
|
-
return MathUtils.euclideanModulo(Wt + Math.PI, Zt) - Math.PI;
|
|
53674
|
-
}
|
|
53675
|
-
lookAtTarget(c, st, Zt, Wt = 0) {
|
|
53676
|
-
return ni(this, null, function* () {
|
|
53677
|
-
const Yt = this.pencil.controls.azimuthAngle, vt = this.pencil.controls.polarAngle, Tt = Yt !== Wt || vt !== Zt;
|
|
53678
|
-
yield Promise.all(
|
|
53679
|
-
[
|
|
53680
|
-
this.pencil.controls.setTarget(c.x, c.y, c.z, !0),
|
|
53681
|
-
this.pencil.controls.dollyTo(st, !0),
|
|
53682
|
-
Tt && this.pencil.controls.rotate(
|
|
53683
|
-
this.absoluteAngle(Wt, Yt),
|
|
53684
|
-
this.absoluteAngle(Zt, vt),
|
|
53685
|
-
!0
|
|
53686
|
-
)
|
|
53687
|
-
].filter(Boolean)
|
|
53688
|
-
);
|
|
53689
|
-
});
|
|
53690
|
-
}
|
|
53691
53701
|
drawBuilding() {
|
|
53692
53702
|
return ni(this, arguments, function* (c = {}) {
|
|
53693
53703
|
var Wt;
|
|
@@ -53975,10 +53985,13 @@ const xn = class xn extends Map$1 {
|
|
|
53975
53985
|
this.mapObj.z + this.mapObj.depth
|
|
53976
53986
|
);
|
|
53977
53987
|
this.emit("beforeDrillDown", "city"), yield this.cityVis.lookAtTarget(
|
|
53978
|
-
|
|
53979
|
-
|
|
53980
|
-
|
|
53981
|
-
|
|
53988
|
+
{
|
|
53989
|
+
target: Xe,
|
|
53990
|
+
distance: vt,
|
|
53991
|
+
polarAngle: Tt,
|
|
53992
|
+
azimuthAngle: Jt
|
|
53993
|
+
},
|
|
53994
|
+
!0
|
|
53982
53995
|
), this.emit("afterDrillDown", "city");
|
|
53983
53996
|
} else
|
|
53984
53997
|
console.error("showCityOnMap lnglat or target is required");
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.21.
|
|
1
|
+
declare const _default: "0.21.29";
|
|
2
2
|
export default _default;
|
package/dist/vis/base/index.d.ts
CHANGED
|
@@ -104,6 +104,13 @@ export default class Base extends Event {
|
|
|
104
104
|
}): Promise<Node>;
|
|
105
105
|
lookAt(positionX: number, positionY: number, positionZ: number, targetX: number, targetY: number, targetZ: number, enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
106
106
|
truck(x: number, y: number, enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
107
|
+
absoluteAngle(targetAngle: number, sourceAngle: number): number;
|
|
108
|
+
lookAtTarget(ops: {
|
|
109
|
+
target?: THREE.Vector3;
|
|
110
|
+
distance?: number;
|
|
111
|
+
polarAngle?: number;
|
|
112
|
+
azimuthAngle?: number;
|
|
113
|
+
}, enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
107
114
|
resetCamera(enableTransition?: boolean, smoothTime?: number): Promise<void>;
|
|
108
115
|
unproject(e: MouseEvent, targetZ?: number): THREE.Vector3;
|
|
109
116
|
getRoomEnvMap(): THREE.Texture;
|
package/dist/vis/city/index.d.ts
CHANGED
|
@@ -88,8 +88,6 @@ export default class extends Base {
|
|
|
88
88
|
fitTo(obj: BaseObject, enableTransition?: boolean): Promise<void>;
|
|
89
89
|
initVis(): Promise<void>;
|
|
90
90
|
fitToTarget(adcode: number, lnglat?: [number, number]): Promise<void>;
|
|
91
|
-
absoluteAngle(targetAngle: number, sourceAngle: number): number;
|
|
92
|
-
lookAtTarget(pos: THREE.Vector3, distance: number, polarAngle: number, azimuthAngle?: number): Promise<void>;
|
|
93
91
|
drawBuilding(options?: {
|
|
94
92
|
json?: {
|
|
95
93
|
features: any[];
|