vis-core 0.21.28 → 0.21.30
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 +67 -63
- package/dist/version.d.ts +1 -1
- package/dist/vis/base/index.d.ts +8 -1
- 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.30";
|
|
48314
48314
|
class Event {
|
|
48315
48315
|
constructor() {
|
|
48316
48316
|
J0(this, "event", new EventEmitter());
|
|
@@ -49583,7 +49583,7 @@ class Base extends Event {
|
|
|
49583
49583
|
J0(this, "visName");
|
|
49584
49584
|
J0(this, "editor");
|
|
49585
49585
|
J0(this, "initSettingsObj");
|
|
49586
|
-
J0(this, "mouseButtonsActiveStore");
|
|
49586
|
+
J0(this, "mouseButtonsActiveStore", null);
|
|
49587
49587
|
if (this.container = c.container, this.options = bi({
|
|
49588
49588
|
assetsPrefix: "",
|
|
49589
49589
|
editor: !0
|
|
@@ -49739,31 +49739,31 @@ class Base extends Event {
|
|
|
49739
49739
|
return (c = this.pencil) == null ? void 0 : c.controls.verticalDragToForward;
|
|
49740
49740
|
}
|
|
49741
49741
|
initSettings() {
|
|
49742
|
-
|
|
49742
|
+
const c = {
|
|
49743
49743
|
mouseLeft: this.leftTruck ? Ts.TRUCK : Ts.ROTATE,
|
|
49744
49744
|
mouseRight: this.leftTruck ? Ts.ROTATE : Ts.TRUCK,
|
|
49745
|
-
mouseWheel: Ts.DOLLY
|
|
49746
|
-
|
|
49747
|
-
|
|
49748
|
-
Ei(bi(bi({}, this.initSettingsObj),
|
|
49749
|
-
mouseNone: !1
|
|
49745
|
+
mouseWheel: Ts.DOLLY
|
|
49746
|
+
};
|
|
49747
|
+
this.settings = new Proxy(
|
|
49748
|
+
Ei(bi(bi({}, this.initSettingsObj), c), {
|
|
49749
|
+
mouseNone: !1,
|
|
49750
|
+
viewportPadding: [0, 0, 0, 0]
|
|
49750
49751
|
}),
|
|
49751
49752
|
{
|
|
49752
|
-
set: (
|
|
49753
|
-
|
|
49754
|
-
|
|
49755
|
-
|
|
49756
|
-
|
|
49757
|
-
const Yt = st.includes(":::");
|
|
49753
|
+
set: (st, Zt, Wt) => {
|
|
49754
|
+
if (!(Zt in st) && !(Zt.replace(/(:::.+)\..*$/, "$1") in st))
|
|
49755
|
+
return Reflect.set({}, Zt, Wt);
|
|
49756
|
+
Zt === "mouseWheel" ? typeof Wt == "boolean" && (Wt = Wt ? c.mouseWheel : Ts.NONE) : Zt === "mouseLeft" ? typeof Wt == "boolean" && (Wt = Wt ? c.mouseLeft : Ts.NONE) : Zt === "mouseRight" && typeof Wt == "boolean" && (Wt = Wt ? c.mouseRight : Ts.NONE);
|
|
49757
|
+
const Yt = Zt.includes(":::");
|
|
49758
49758
|
return Reflect.set(
|
|
49759
|
-
|
|
49760
|
-
Yt ?
|
|
49761
|
-
this.handleSetting(
|
|
49759
|
+
st,
|
|
49760
|
+
Yt ? Zt.replace(/(:::.+)\..*$/, "$1") : Zt,
|
|
49761
|
+
this.handleSetting(Zt, Wt)
|
|
49762
49762
|
);
|
|
49763
49763
|
},
|
|
49764
|
-
get: (
|
|
49765
|
-
const
|
|
49766
|
-
return
|
|
49764
|
+
get: (st, Zt) => {
|
|
49765
|
+
const Yt = Zt.includes(":::") ? Zt.replace(/(:::.+)\..*$/, "$1") : Zt, vt = Reflect.get(st, Yt);
|
|
49766
|
+
return vt instanceof Promise ? vt.then((Tt) => (Reflect.set(st, Yt, Tt), Tt)) : vt;
|
|
49767
49767
|
}
|
|
49768
49768
|
}
|
|
49769
49769
|
);
|
|
@@ -49772,22 +49772,13 @@ class Base extends Event {
|
|
|
49772
49772
|
return ni(this, null, function* () {
|
|
49773
49773
|
const { pencil: Zt } = this;
|
|
49774
49774
|
if (c === "mouseWheel" || c === "mouseLeft" || c === "mouseRight") {
|
|
49775
|
-
|
|
49776
|
-
|
|
49777
|
-
|
|
49778
|
-
|
|
49779
|
-
|
|
49780
|
-
|
|
49781
|
-
|
|
49782
|
-
this.mouseButtonsActiveStore.mouseLeft
|
|
49783
|
-
), this.handleSetting(
|
|
49784
|
-
"mouseRight",
|
|
49785
|
-
this.mouseButtonsActiveStore.mouseRight
|
|
49786
|
-
), this.handleSetting(
|
|
49787
|
-
"mouseWheel",
|
|
49788
|
-
this.mouseButtonsActiveStore.mouseWheel
|
|
49789
|
-
);
|
|
49790
|
-
}) : c === "viewportPadding" && Zt.setViewPadding(...st);
|
|
49775
|
+
const Wt = c.replace("mouse", "").toLowerCase();
|
|
49776
|
+
(st || this.playing) && (Zt.controls.mouseButtons[Wt] = st);
|
|
49777
|
+
} else c === "mouseNone" ? st ? (this.mouseButtonsActiveStore = {
|
|
49778
|
+
mouseLeft: Zt.controls.mouseButtons.left,
|
|
49779
|
+
mouseRight: Zt.controls.mouseButtons.right,
|
|
49780
|
+
mouseWheel: Zt.controls.mouseButtons.wheel
|
|
49781
|
+
}, Zt.controls.mouseButtons.left = Ts.NONE, Zt.controls.mouseButtons.right = Ts.NONE, Zt.controls.mouseButtons.wheel = Ts.NONE) : this.mouseButtonsActiveStore && (Zt.controls.mouseButtons.left = this.mouseButtonsActiveStore.mouseLeft, Zt.controls.mouseButtons.right = this.mouseButtonsActiveStore.mouseRight, Zt.controls.mouseButtons.wheel = this.mouseButtonsActiveStore.mouseWheel) : c === "viewportPadding" && Zt.setViewPadding(...st);
|
|
49791
49782
|
return st;
|
|
49792
49783
|
});
|
|
49793
49784
|
}
|
|
@@ -49840,6 +49831,32 @@ class Base extends Event {
|
|
|
49840
49831
|
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
49832
|
});
|
|
49842
49833
|
}
|
|
49834
|
+
absoluteAngle(c, st) {
|
|
49835
|
+
const Zt = Math.PI * 2, Wt = c - st;
|
|
49836
|
+
return MathUtils.euclideanModulo(Wt + Math.PI, Zt) - Math.PI;
|
|
49837
|
+
}
|
|
49838
|
+
lookAtTarget(c, st = !1, Zt = 250) {
|
|
49839
|
+
return ni(this, null, function* () {
|
|
49840
|
+
this.pencil.controls.smoothTime = Zt / 1e3;
|
|
49841
|
+
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);
|
|
49842
|
+
yield Promise.all(
|
|
49843
|
+
[
|
|
49844
|
+
qe && this.pencil.controls.setTarget(
|
|
49845
|
+
Xe.x,
|
|
49846
|
+
Xe.y,
|
|
49847
|
+
Xe.z,
|
|
49848
|
+
st
|
|
49849
|
+
),
|
|
49850
|
+
Qe && this.pencil.controls.dollyTo(de, st),
|
|
49851
|
+
Ke && this.pencil.controls.rotate(
|
|
49852
|
+
this.absoluteAngle(Jt, Wt),
|
|
49853
|
+
this.absoluteAngle($t, Yt),
|
|
49854
|
+
st
|
|
49855
|
+
)
|
|
49856
|
+
].filter(Boolean)
|
|
49857
|
+
), this.pencil.controls.smoothTime = 250 / 1e3;
|
|
49858
|
+
});
|
|
49859
|
+
}
|
|
49843
49860
|
resetCamera(c = !1, st = 250) {
|
|
49844
49861
|
return ni(this, null, function* () {
|
|
49845
49862
|
this.pencil.controls.smoothTime = st / 1e3, yield this.pencil.controls.reset(c), this.pencil.controls.smoothTime = 250 / 1e3;
|
|
@@ -53661,33 +53678,17 @@ class City$1 extends Base {
|
|
|
53661
53678
|
}
|
|
53662
53679
|
const Wt = Zt.object3d.getWorldPosition(new Vector3());
|
|
53663
53680
|
yield this.lookAtTarget(
|
|
53664
|
-
|
|
53665
|
-
|
|
53666
|
-
|
|
53681
|
+
{
|
|
53682
|
+
target: Wt,
|
|
53683
|
+
distance: 6.984429017840711 * this.multiplyScalar,
|
|
53684
|
+
polarAngle: 0.9963693538268685,
|
|
53685
|
+
azimuthAngle: 0
|
|
53686
|
+
},
|
|
53687
|
+
!0
|
|
53667
53688
|
);
|
|
53668
53689
|
}
|
|
53669
53690
|
});
|
|
53670
53691
|
}
|
|
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
53692
|
drawBuilding() {
|
|
53692
53693
|
return ni(this, arguments, function* (c = {}) {
|
|
53693
53694
|
var Wt;
|
|
@@ -53975,10 +53976,13 @@ const xn = class xn extends Map$1 {
|
|
|
53975
53976
|
this.mapObj.z + this.mapObj.depth
|
|
53976
53977
|
);
|
|
53977
53978
|
this.emit("beforeDrillDown", "city"), yield this.cityVis.lookAtTarget(
|
|
53978
|
-
|
|
53979
|
-
|
|
53980
|
-
|
|
53981
|
-
|
|
53979
|
+
{
|
|
53980
|
+
target: Xe,
|
|
53981
|
+
distance: vt,
|
|
53982
|
+
polarAngle: Tt,
|
|
53983
|
+
azimuthAngle: Jt
|
|
53984
|
+
},
|
|
53985
|
+
!0
|
|
53982
53986
|
), this.emit("afterDrillDown", "city");
|
|
53983
53987
|
} else
|
|
53984
53988
|
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.30";
|
|
2
2
|
export default _default;
|
package/dist/vis/base/index.d.ts
CHANGED
|
@@ -88,7 +88,7 @@ export default class Base extends Event {
|
|
|
88
88
|
initSettingsObj?: Record<string, any>;
|
|
89
89
|
set verticalDragToForward(value: boolean);
|
|
90
90
|
get verticalDragToForward(): boolean;
|
|
91
|
-
mouseButtonsActiveStore: Record<string, any
|
|
91
|
+
mouseButtonsActiveStore: Record<string, any> | null;
|
|
92
92
|
initSettings(): void;
|
|
93
93
|
handleSetting(key: string, value: any): Promise<any>;
|
|
94
94
|
show(): void;
|
|
@@ -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[];
|