vis-core 0.24.2 → 0.24.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/editor/viewport.d.ts +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/index.module.js +127 -118
- package/dist/version.d.ts +1 -1
- package/dist/vis/base/index.d.ts +3 -0
- package/dist/vis/map/index.d.ts +4 -3
- package/package.json +2 -2
package/dist/index.module.js
CHANGED
|
@@ -90,7 +90,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
|
|
|
90
90
|
).toString(CryptoJS.enc.Utf8), qe = JSON.parse($e), rt = Date.now();
|
|
91
91
|
return !qe.s || qe.s > rt ? (this.token = void 0, "") : qe.e && qe.e < rt ? (this.token = void 0, "") : (qe.isValid = Qe, qe);
|
|
92
92
|
}
|
|
93
|
-
}, version = "0.24.
|
|
93
|
+
}, version = "0.24.4";
|
|
94
94
|
/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2010-2025 Three.js Authors
|
|
@@ -36542,7 +36542,6 @@ let Ge$1 = class {
|
|
|
36542
36542
|
})), this.finalComposerRender());
|
|
36543
36543
|
} else
|
|
36544
36544
|
this.finalComposerRender();
|
|
36545
|
-
this.finalComposerRender();
|
|
36546
36545
|
}
|
|
36547
36546
|
dispose() {
|
|
36548
36547
|
var e;
|
|
@@ -48999,7 +48998,7 @@ class SetValue extends Command {
|
|
|
48999
48998
|
}
|
|
49000
48999
|
execute() {
|
|
49001
49000
|
const e = this.properties ? this.object[this.properties] : this.object;
|
|
49002
|
-
e && (e instanceof RectAreaLight && this.attributeName === "castShadow" || (e[this.attributeName] = this.newValue, this.fixObj(), this.editor.emit("objectChanged", this.object), setTimeout(() => {
|
|
49001
|
+
e && ((e instanceof RectAreaLight || e instanceof AmbientLight) && this.attributeName === "castShadow" || (e[this.attributeName] = this.newValue, this.fixObj(), this.editor.emit("objectChanged", this.object), setTimeout(() => {
|
|
49003
49002
|
this.attributeName === "name" && this.editor.pencil.event.emit("object3dListChange");
|
|
49004
49003
|
})));
|
|
49005
49004
|
}
|
|
@@ -49473,20 +49472,14 @@ class Viewport {
|
|
|
49473
49472
|
w0(this, "editor");
|
|
49474
49473
|
w0(this, "vis");
|
|
49475
49474
|
w0(this, "extendsOptions", {});
|
|
49475
|
+
w0(this, "cameraState", {});
|
|
49476
49476
|
w0(this, "delLoadObj");
|
|
49477
49477
|
w0(this, "options");
|
|
49478
49478
|
this.options = s, this.editor = e;
|
|
49479
49479
|
}
|
|
49480
|
-
setSaveCamera() {
|
|
49481
|
-
|
|
49482
|
-
|
|
49483
|
-
const e = this.vis.pencil, s = e.cameraPositon, r = e.cameraTarget;
|
|
49484
|
-
yield this.editor.execute(
|
|
49485
|
-
new SetPosition(this.editor, e.camera, s, s, e.controls)
|
|
49486
|
-
), yield this.editor.execute(
|
|
49487
|
-
new SetTarget(this.editor, e.camera, r, r, e.controls)
|
|
49488
|
-
), (T = e.controls) == null || T.saveState();
|
|
49489
|
-
});
|
|
49480
|
+
setSaveCamera(e) {
|
|
49481
|
+
var s, r;
|
|
49482
|
+
this.vis.setSaveCamera(e), (s = this.vis.pencil.controls) == null || s.saveState(), this.cameraState = ai({}, (r = this.vis) == null ? void 0 : r.cameraState), this.editor.emit("cameraStateChanged");
|
|
49490
49483
|
}
|
|
49491
49484
|
addVis(r) {
|
|
49492
49485
|
return q0(this, arguments, function* (e, s = {}) {
|
|
@@ -49510,7 +49503,7 @@ class Viewport {
|
|
|
49510
49503
|
if (this.vis = this.options.visFactories, this.vis.visName !== e)
|
|
49511
49504
|
throw new Error(`visName is not match, import {${e}}`);
|
|
49512
49505
|
const T = this.editor.hooks.events.beforeSetVisOptions.length ? this.editor.hooks.dispatch("beforeSetVisOptions", s) : s;
|
|
49513
|
-
this.vis.setOptions(ai(ai({}, T), this.extendsOptions)), this.delLoadObj && (this.vis.delLoadArr = this.delLoadObj), this.vis.playing = this.editor.playing, this.vis._baseObjectByUuid = this.editor.baseObjectByUuid.bind(this.editor), this.vis.on("loaderProgress", (Je, Ke) => {
|
|
49506
|
+
this.vis.setOptions(ai(ai({}, T), this.extendsOptions)), this.vis.cameraState = ai({}, this.cameraState), this.delLoadObj && (this.vis.delLoadArr = this.delLoadObj), this.vis.playing = this.editor.playing, this.vis._baseObjectByUuid = this.editor.baseObjectByUuid.bind(this.editor), this.vis.on("loaderProgress", (Je, Ke) => {
|
|
49514
49507
|
this.editor.emit("progress", {
|
|
49515
49508
|
type: "下载资源",
|
|
49516
49509
|
value: Je / Ke * 100 | 0
|
|
@@ -49581,11 +49574,12 @@ class Viewport {
|
|
|
49581
49574
|
const e = (s = this.vis) == null ? void 0 : s.loader.getUnusedAssets();
|
|
49582
49575
|
return {
|
|
49583
49576
|
eo: this.extendsOptions,
|
|
49577
|
+
cs: this.cameraState,
|
|
49584
49578
|
delLoadObj: e
|
|
49585
49579
|
};
|
|
49586
49580
|
}
|
|
49587
49581
|
fromJSON(e) {
|
|
49588
|
-
this.extendsOptions = e.eo || {}, e.delLoadObj && e.delLoadObj.length && (this.delLoadObj = [...e.delLoadObj]);
|
|
49582
|
+
this.extendsOptions = e.eo || {}, this.cameraState = e.cs || {}, e.delLoadObj && e.delLoadObj.length && (this.delLoadObj = [...e.delLoadObj]);
|
|
49589
49583
|
}
|
|
49590
49584
|
getLoadObj() {
|
|
49591
49585
|
return this.vis ? [...this.vis.loader.assets.keys()].filter((s) => this.vis.loader.delLoadArr.indexOf(s) === -1) : [];
|
|
@@ -49597,7 +49591,7 @@ class Viewport {
|
|
|
49597
49591
|
}
|
|
49598
49592
|
dispose() {
|
|
49599
49593
|
var e;
|
|
49600
|
-
(e = this.vis) == null || e.dispose(), this.options.visFactories = void 0, this.extendsOptions = {}, this.delLoadObj = void 0, this.vis = void 0, this.editor.history.clear();
|
|
49594
|
+
(e = this.vis) == null || e.dispose(), this.options.visFactories = void 0, this.extendsOptions = {}, this.cameraState = {}, this.delLoadObj = void 0, this.vis = void 0, this.editor.history.clear();
|
|
49601
49595
|
}
|
|
49602
49596
|
}
|
|
49603
49597
|
const compareVersion = (c, e) => {
|
|
@@ -50560,6 +50554,7 @@ class Base extends Event {
|
|
|
50560
50554
|
w0(this, "visName");
|
|
50561
50555
|
w0(this, "editor");
|
|
50562
50556
|
w0(this, "tier0", !1);
|
|
50557
|
+
w0(this, "cameraState", {});
|
|
50563
50558
|
w0(this, "_baseObjectByUuid");
|
|
50564
50559
|
w0(this, "initSettingsObj");
|
|
50565
50560
|
w0(this, "mouseButtonsActiveStore", null);
|
|
@@ -50800,9 +50795,27 @@ class Base extends Event {
|
|
|
50800
50795
|
return r;
|
|
50801
50796
|
});
|
|
50802
50797
|
}
|
|
50798
|
+
setSaveCamera(s) {
|
|
50799
|
+
const r = this.pencil, T = r.cameraPositon, de = r.cameraTarget;
|
|
50800
|
+
this.cameraState[s] = [T.x, T.y, T.z, de.x, de.y, de.z];
|
|
50801
|
+
}
|
|
50802
|
+
useSaveCamera(s, r = !1) {
|
|
50803
|
+
return q0(this, null, function* () {
|
|
50804
|
+
const T = this.cameraState[s], de = this.pencil.controls;
|
|
50805
|
+
return T ? (yield de.setLookAt(
|
|
50806
|
+
T[0],
|
|
50807
|
+
T[1],
|
|
50808
|
+
T[2],
|
|
50809
|
+
T[3],
|
|
50810
|
+
T[4],
|
|
50811
|
+
T[5],
|
|
50812
|
+
r
|
|
50813
|
+
), !0) : !1;
|
|
50814
|
+
});
|
|
50815
|
+
}
|
|
50803
50816
|
show() {
|
|
50804
50817
|
var s, r, T;
|
|
50805
|
-
this.showState || this.options.disableInitShow
|
|
50818
|
+
this.useSaveCamera("visShow"), !(this.showState || this.options.disableInitShow) && (this.showState = "ing", (s = this.drawController.group) == null || s.show(), (r = this.drawController.prefabGroup) == null || r.show(), this.playing && ((T = this.drawController.prefabGroup) == null || T.hide()), this.pencil.start(), this.showState = !0, this.emit("show"));
|
|
50806
50819
|
}
|
|
50807
50820
|
hide() {
|
|
50808
50821
|
var s, r;
|
|
@@ -50901,7 +50914,7 @@ class Base extends Event {
|
|
|
50901
50914
|
}
|
|
50902
50915
|
dispose() {
|
|
50903
50916
|
var s, r, T;
|
|
50904
|
-
super.dispose(), this.editor && (this.editor.viewport.vis = void 0, this.editor.dispose()), (s = this.pencil) == null || s.dispose(), (r = this.pmremGenerator) == null || r.dispose(), (T = this.re) == null || T.dispose();
|
|
50917
|
+
super.dispose(), this.editor && (this.editor.viewport.vis = void 0, this.editor.dispose()), this.cameraState = {}, (s = this.pencil) == null || s.dispose(), (r = this.pmremGenerator) == null || r.dispose(), (T = this.re) == null || T.dispose();
|
|
50905
50918
|
}
|
|
50906
50919
|
}
|
|
50907
50920
|
w0(Base, "VisName", "base");
|
|
@@ -129605,7 +129618,7 @@ let PlaneMap$1 = class extends A$1 {
|
|
|
129605
129618
|
});
|
|
129606
129619
|
}
|
|
129607
129620
|
pickArea(s) {
|
|
129608
|
-
const { pencil: r } = this, T = this.areaArr.map((Xe) => Xe.object3d), de = r.pick(s, T, !
|
|
129621
|
+
const { pencil: r } = this, T = this.areaArr.map((Xe) => Xe.object3d), de = r.pick(s, T, !1);
|
|
129609
129622
|
if (de)
|
|
129610
129623
|
return this.drawController.objMap.get(de.object);
|
|
129611
129624
|
}
|
|
@@ -130866,7 +130879,7 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
130866
130879
|
color: "#000000"
|
|
130867
130880
|
}), T = new MeshBasicMaterial({
|
|
130868
130881
|
name: "侧面",
|
|
130869
|
-
color: "#
|
|
130882
|
+
color: "#051714",
|
|
130870
130883
|
side: DoubleSide
|
|
130871
130884
|
}), de = new it$1({
|
|
130872
130885
|
color: new Color$1("#50766E"),
|
|
@@ -131065,7 +131078,7 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131065
131078
|
show() {
|
|
131066
131079
|
return q0(this, null, function* () {
|
|
131067
131080
|
if (this.showState || this.options.disableInitShow) return;
|
|
131068
|
-
l1(d1.prototype, this, "show").call(this);
|
|
131081
|
+
this.useSaveCamera(`map-${this.options.adcode}`), l1(d1.prototype, this, "show").call(this);
|
|
131069
131082
|
const s = this.drawController.group;
|
|
131070
131083
|
this.mapHistory[0] && (yield sinusoidalInOut({
|
|
131071
131084
|
onUpdate: (r) => {
|
|
@@ -131252,64 +131265,66 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131252
131265
|
booleanPointInCn(s) {
|
|
131253
131266
|
return chinaLiteJson.features[0].geometry.coordinates.some((r) => booleanPointInPolygon$1(point(s), polygon(r)));
|
|
131254
131267
|
}
|
|
131255
|
-
handleDrillDown(
|
|
131268
|
+
handleDrillDown(Xe) {
|
|
131256
131269
|
return q0(this, arguments, function* ({
|
|
131257
131270
|
adcode: s,
|
|
131258
131271
|
duration: r,
|
|
131259
|
-
saveBackCamvasState: T
|
|
131272
|
+
saveBackCamvasState: T,
|
|
131273
|
+
extrudelineBloom: de
|
|
131260
131274
|
}) {
|
|
131261
|
-
var
|
|
131275
|
+
var Je, Ke, Qe, _e, $e, qe, rt, dt;
|
|
131262
131276
|
if (typeof s != "undefined" && !this.isAnimating) {
|
|
131263
|
-
const
|
|
131264
|
-
if (this.isAnimating || !
|
|
131277
|
+
const Wt = (Je = this.map) == null ? void 0 : Je.findGroup(s, !0), Yt = findLevelJsonItem2(+s);
|
|
131278
|
+
if (this.isAnimating || !Yt) return;
|
|
131265
131279
|
this.isAnimating = !0;
|
|
131266
|
-
const { name:
|
|
131267
|
-
let { res:
|
|
131280
|
+
const { name: st } = Yt;
|
|
131281
|
+
let { res: Zt } = (Ke = this.options.geojsonMap) != null && Ke[s] ? { res: (Qe = this.options.geojsonMap) == null ? void 0 : Qe[s] } : yield jsonFetch(
|
|
131268
131282
|
`${this.options.assetsPrefix}/geojson/json/${s}.json`
|
|
131269
|
-
), { res:
|
|
131283
|
+
), { res: vt } = this.options.extrudeLine ? (_e = this.options.extrudeLineGeojsonMap) != null && _e[s] ? { res: ($e = this.options.extrudeLineGeojsonMap) == null ? void 0 : $e[s] } : yield jsonFetch(
|
|
131270
131284
|
`${this.options.assetsPrefix}/geojson/json-lite/${s}.json`
|
|
131271
131285
|
) : {
|
|
131272
131286
|
res: void 0
|
|
131273
131287
|
};
|
|
131274
|
-
if (!this.options.showDistrict && this.getAdcodeShowLevel(s) === "city" && (
|
|
131275
|
-
if (!
|
|
131276
|
-
const
|
|
131277
|
-
|
|
131278
|
-
center: [
|
|
131288
|
+
if (!this.options.showDistrict && this.getAdcodeShowLevel(s) === "city" && (Zt = vt, vt = void 0), [Zt, vt].filter(Boolean).forEach((Jt) => {
|
|
131289
|
+
if (!Jt.features[0].properties.adcode && /^\d{6}$/.test(`${s}`)) {
|
|
131290
|
+
const $t = adcodeMap[s];
|
|
131291
|
+
Jt.features[0].properties = zi(ai(ai({}, Jt.features[0].properties), $t), {
|
|
131292
|
+
center: [$t.lng, $t.lat]
|
|
131279
131293
|
});
|
|
131280
131294
|
}
|
|
131281
|
-
}),
|
|
131282
|
-
const
|
|
131283
|
-
if (
|
|
131284
|
-
const a0 = (
|
|
131295
|
+
}), Zt) {
|
|
131296
|
+
const Jt = this.options.plateInCenter && (this.mapHistory.length < 1 || this.options.drillDownPlateInCenter);
|
|
131297
|
+
if (Jt && this.fixNear(s), (qe = this.options.fixGeojson) != null && qe[s]) {
|
|
131298
|
+
const a0 = (rt = this.options.fixGeojson) == null ? void 0 : rt[s];
|
|
131285
131299
|
if (a0.startsWith("-")) {
|
|
131286
131300
|
const m0 = +a0.slice(1);
|
|
131287
|
-
|
|
131301
|
+
Zt.features = Zt.features.filter((I0) => I0.properties.adcode !== m0);
|
|
131288
131302
|
}
|
|
131289
131303
|
}
|
|
131290
|
-
|
|
131291
|
-
this.eraseLabels(), this.map && (this.options.drillDownHideParent && this.parentBg.forEach((a0) => {
|
|
131304
|
+
let $t = this.options.bboxMap[s] || bbox(vt || Zt);
|
|
131305
|
+
this.options.bboxMap[s] = $t, this.mapHistory.length === 1 && !this.options.drillDownSecondLevelMats ? $t = this.options.bboxMap[this.mapInfo.adcode] : this.mapHistory.length === 2 && !this.options.drillDownThirdLevelMats && (this.options.drillDownSecondLevelMats ? $t = this.options.bboxMap[this.mapInfo.adcode] : $t = this.options.bboxMap[this.mapHistory[0].mapInfo.adcode]), this.eraseLabels(), this.map && (this.options.drillDownHideParent && this.parentBg.forEach((a0) => {
|
|
131292
131306
|
a0.hide();
|
|
131293
131307
|
}), this.options.showOneLevel ? this.map.hide() : this.map.deactive(), (T != null ? T : this.options.handleBackKeepCamvasState) && this.saveBackCamvasState(-1));
|
|
131294
|
-
const e0 = this.mapHistory.length, t0 = e0 - 1, i0 = this.getDepth(s,
|
|
131295
|
-
geojson:
|
|
131296
|
-
extrudeLineGeojson:
|
|
131308
|
+
const e0 = this.mapHistory.length, t0 = e0 - 1, i0 = this.getDepth(s, $t), n0 = (dt = this.mapHistory[t0]) == null ? void 0 : dt.depth, s0 = e0 === 0 ? 0 : this.mapHistory[t0].z + (this.options.showOneLevel ? 0 : n0), d0 = e0 === 0 ? 0 : s0 - i0, u0 = center(Zt).geometry.coordinates, [G0, h0] = this.projection(u0), l0 = yield this.drawPlaneMap({
|
|
131309
|
+
geojson: Zt,
|
|
131310
|
+
extrudeLineGeojson: vt,
|
|
131297
131311
|
depth: i0,
|
|
131298
|
-
bbox: $t
|
|
131299
|
-
adcode: s
|
|
131312
|
+
bbox: $t,
|
|
131313
|
+
adcode: s,
|
|
131314
|
+
extrudelineBloom: de
|
|
131300
131315
|
});
|
|
131301
131316
|
l0.position.setZ(d0), this.mapHistory.push({
|
|
131302
131317
|
map: l0,
|
|
131303
|
-
mapInfo:
|
|
131318
|
+
mapInfo: Yt,
|
|
131304
131319
|
z: s0,
|
|
131305
131320
|
depth: i0,
|
|
131306
131321
|
cX: G0,
|
|
131307
131322
|
cY: -h0
|
|
131308
131323
|
});
|
|
131309
131324
|
const c0 = l0.position.z;
|
|
131310
|
-
|
|
131325
|
+
Jt && (l0.position.z = s0, this.fitTo(l0, {
|
|
131311
131326
|
enableTransition: r !== 0
|
|
131312
|
-
}), l0.position.z = c0),
|
|
131327
|
+
}), l0.position.z = c0), Wt == null || Wt.hide(), this.map && e0 !== 0 && (r ? yield sinusoidalInOut({
|
|
131313
131328
|
onUpdate: (a0) => {
|
|
131314
131329
|
this.map.position.z = c0 + (s0 - c0) * a0;
|
|
131315
131330
|
}
|
|
@@ -131317,7 +131332,7 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131317
131332
|
duration: r
|
|
131318
131333
|
}) : this.map.position.z = s0), this.drawLabels();
|
|
131319
131334
|
} else
|
|
131320
|
-
console.log(`${
|
|
131335
|
+
console.log(`${st}的地图数据不存在`);
|
|
131321
131336
|
this.event.emit("handleDrillDown", {
|
|
131322
131337
|
adcode: s,
|
|
131323
131338
|
z: this.mapObj.z + this.mapObj.depth
|
|
@@ -131344,22 +131359,12 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131344
131359
|
azimuthAngle: T,
|
|
131345
131360
|
enableTransition: de = !0
|
|
131346
131361
|
} = {}) {
|
|
131347
|
-
var Wt
|
|
131348
|
-
if (!(s != null && s.object3d)
|
|
131349
|
-
|
|
131350
|
-
|
|
131351
|
-
|
|
131352
|
-
yield (st = this.pencil.controls) == null ? void 0 : st.setLookAt(
|
|
131353
|
-
Zt,
|
|
131354
|
-
vt,
|
|
131355
|
-
Tt,
|
|
131356
|
-
Jt,
|
|
131357
|
-
$t,
|
|
131358
|
-
e0,
|
|
131359
|
-
de
|
|
131360
|
-
);
|
|
131362
|
+
var Wt;
|
|
131363
|
+
if (!(s != null && s.object3d) || (yield this.useSaveCamera(
|
|
131364
|
+
`map-${(Wt = this.mapInfo) == null ? void 0 : Wt.adcode}`,
|
|
131365
|
+
de
|
|
131366
|
+
)))
|
|
131361
131367
|
return;
|
|
131362
|
-
}
|
|
131363
131368
|
const Ke = this.options.mapPadding, { height: Qe, width: _e } = this.pencil.getSize();
|
|
131364
131369
|
Qe < Ke[0] + Ke[2] + 100 && (Ke[0] = 0, Ke[2] = 0), _e < Ke[1] + Ke[3] + 100 && (Ke[1] = 0, Ke[3] = 0);
|
|
131365
131370
|
const $e = r || this.options.polarAngle, qe = T || this.options.azimuthAngle, rt = this.pencil.controls.azimuthAngle, dt = this.pencil.controls.polarAngle;
|
|
@@ -131402,35 +131407,36 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131402
131407
|
paddingTop: st
|
|
131403
131408
|
});
|
|
131404
131409
|
}
|
|
131405
|
-
drawPlaneMap(
|
|
131410
|
+
drawPlaneMap(Ke) {
|
|
131406
131411
|
return q0(this, arguments, function* ({
|
|
131407
131412
|
geojson: s,
|
|
131408
131413
|
extrudeLineGeojson: r,
|
|
131409
131414
|
bbox: T,
|
|
131410
131415
|
depth: de,
|
|
131411
|
-
|
|
131416
|
+
extrudelineBloom: Xe,
|
|
131417
|
+
adcode: Je
|
|
131412
131418
|
}) {
|
|
131413
|
-
const
|
|
131419
|
+
const Qe = [
|
|
131414
131420
|
this.mList.getMaterialObj("plane"),
|
|
131415
131421
|
this.mList.getMaterialObj("secondPlane"),
|
|
131416
131422
|
this.mList.getMaterialObj("thirdPlane")
|
|
131417
131423
|
];
|
|
131418
|
-
let
|
|
131419
|
-
for (;
|
|
131420
|
-
|
|
131421
|
-
const
|
|
131422
|
-
bgTopMat:
|
|
131423
|
-
bgSideMat:
|
|
131424
|
-
bgLineMat:
|
|
131425
|
-
bgExtrudeLineMat:
|
|
131424
|
+
let _e = this.mapHistory.length, $e;
|
|
131425
|
+
for (; !$e; )
|
|
131426
|
+
$e = Qe[_e], _e--;
|
|
131427
|
+
const qe = this.mList.getMaterialObj("bgPlane"), rt = ai(ai({}, $e), qe ? {
|
|
131428
|
+
bgTopMat: qe.topMat,
|
|
131429
|
+
bgSideMat: qe.sideMat,
|
|
131430
|
+
bgLineMat: qe.lineMat,
|
|
131431
|
+
bgExtrudeLineMat: qe.extrudeLineMat
|
|
131426
131432
|
} : {});
|
|
131427
|
-
let
|
|
131428
|
-
this.options.cityOnMap && r && (
|
|
131429
|
-
const
|
|
131433
|
+
let dt = s, Wt = r;
|
|
131434
|
+
this.options.cityOnMap && r && (dt = r, this.options.showCityOnMapInnerLine ? Wt = s : Wt = void 0);
|
|
131435
|
+
const Yt = yield this.drawController.draw(
|
|
131430
131436
|
"PlaneMap",
|
|
131431
131437
|
{
|
|
131432
|
-
geojson:
|
|
131433
|
-
extrudeLineGeojson:
|
|
131438
|
+
geojson: dt,
|
|
131439
|
+
extrudeLineGeojson: Wt,
|
|
131434
131440
|
depth: de,
|
|
131435
131441
|
projection: {
|
|
131436
131442
|
center: this.pcenter,
|
|
@@ -131438,7 +131444,7 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131438
131444
|
rotate: this.options.worldPacificCentre ? [-160, 0] : void 0,
|
|
131439
131445
|
projectionType: this.options.projectionType
|
|
131440
131446
|
},
|
|
131441
|
-
materialOptions:
|
|
131447
|
+
materialOptions: rt,
|
|
131442
131448
|
bbox: T,
|
|
131443
131449
|
topSegments: this.options.topSegments,
|
|
131444
131450
|
lineOffset: this.options.lineOffset,
|
|
@@ -131446,16 +131452,18 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131446
131452
|
},
|
|
131447
131453
|
this.group
|
|
131448
131454
|
);
|
|
131449
|
-
return this.mapHistory.length === 0
|
|
131455
|
+
return this.mapHistory.length === 0 ? (this.mList.setFixMeshList("area", ["plane#topMat", "plane#sideMat"], {
|
|
131450
131456
|
name: "板块"
|
|
131451
131457
|
}), this.mList.setFixMeshList("line", "plane#lineMat", {
|
|
131452
131458
|
name: "板块线"
|
|
131453
|
-
}),
|
|
131454
|
-
|
|
131455
|
-
baseObject:
|
|
131459
|
+
}), Yt.extrudelineArr && Yt.extrudelineArr.forEach((st) => {
|
|
131460
|
+
st.object3d.name = "板块边线", this.mList.setObject3d(st.object3d, "extrudeLine", {
|
|
131461
|
+
baseObject: st,
|
|
131456
131462
|
replace: !0
|
|
131457
|
-
}), this.initBaseObjectUserData(
|
|
131458
|
-
}))
|
|
131463
|
+
}), this.initBaseObjectUserData(st), Xe && (st.object3d.userData.bloom = !0);
|
|
131464
|
+
})) : Yt.extrudelineArr && Xe && Yt.extrudelineArr.forEach((st) => {
|
|
131465
|
+
this.initBaseObjectUserData(st), st.object3d.userData.bloom = !0;
|
|
131466
|
+
}), Yt;
|
|
131459
131467
|
});
|
|
131460
131468
|
}
|
|
131461
131469
|
handleBack() {
|
|
@@ -131522,7 +131530,7 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131522
131530
|
}
|
|
131523
131531
|
setAdcode(T) {
|
|
131524
131532
|
return q0(this, arguments, function* ({ adcodes: s, duration: r }) {
|
|
131525
|
-
var Xe, Je, Ke
|
|
131533
|
+
var Xe, Je, Ke;
|
|
131526
131534
|
const { adcodes: de } = this;
|
|
131527
131535
|
if (!(JSON.stringify(s) === JSON.stringify(de) || this.isAnimating))
|
|
131528
131536
|
if (JSON.stringify(s) === JSON.stringify([0]))
|
|
@@ -131531,44 +131539,45 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131531
131539
|
adcode: 0,
|
|
131532
131540
|
duration: r
|
|
131533
131541
|
});
|
|
131534
|
-
} catch (
|
|
131535
|
-
console.error(
|
|
131542
|
+
} catch (rt) {
|
|
131543
|
+
console.error(rt);
|
|
131536
131544
|
}
|
|
131537
131545
|
else {
|
|
131538
|
-
const { continent:
|
|
131539
|
-
(
|
|
131540
|
-
const
|
|
131541
|
-
return d0
|
|
131546
|
+
const { continent: rt, country: dt, province: Wt, city: Yt, district: st } = s.reduce(
|
|
131547
|
+
(n0, s0) => {
|
|
131548
|
+
const d0 = this.getAdcodeShowLevel(s0);
|
|
131549
|
+
return n0[d0] = s0, n0;
|
|
131542
131550
|
},
|
|
131543
131551
|
{}
|
|
131544
131552
|
), {
|
|
131545
|
-
continent:
|
|
131546
|
-
country:
|
|
131547
|
-
province:
|
|
131548
|
-
city:
|
|
131549
|
-
district:
|
|
131553
|
+
continent: Zt,
|
|
131554
|
+
country: vt,
|
|
131555
|
+
province: Tt,
|
|
131556
|
+
city: Jt,
|
|
131557
|
+
district: $t
|
|
131550
131558
|
} = de.reduce(
|
|
131551
|
-
(
|
|
131552
|
-
const
|
|
131553
|
-
return d0
|
|
131559
|
+
(n0, s0) => {
|
|
131560
|
+
const d0 = this.getAdcodeShowLevel(s0);
|
|
131561
|
+
return n0[d0] = s0, n0;
|
|
131554
131562
|
},
|
|
131555
131563
|
{}
|
|
131556
|
-
),
|
|
131557
|
-
[Tt, Jt, $t
|
|
131558
|
-
[
|
|
131564
|
+
), e0 = rt || Zt, t0 = (Ke = (Je = (Xe = this.map) == null ? void 0 : Xe.extrudelineArr) == null ? void 0 : Je[0]) == null ? void 0 : Ke.object3d.userData.bloom, i0 = this.compareLocations(
|
|
131565
|
+
[Zt, vt, Tt, Jt, $t],
|
|
131566
|
+
[rt, dt, Wt, Yt, st]
|
|
131559
131567
|
);
|
|
131560
131568
|
try {
|
|
131561
|
-
for (var Qe = F1(
|
|
131562
|
-
const [
|
|
131563
|
-
const
|
|
131564
|
-
|
|
131565
|
-
duration:
|
|
131566
|
-
handleLookBack: !!
|
|
131567
|
-
keepOne: !
|
|
131569
|
+
for (var Qe = F1(i0.entries()), _e, $e, qe; _e = !($e = yield Qe.next()).done; _e = !1) {
|
|
131570
|
+
const [n0, s0] = $e.value;
|
|
131571
|
+
const d0 = n0 === i0.length - 1 ? r : 0;
|
|
131572
|
+
s0 === -1 ? yield this.handleBack({
|
|
131573
|
+
duration: d0,
|
|
131574
|
+
handleLookBack: !!d0,
|
|
131575
|
+
keepOne: !e0
|
|
131568
131576
|
}) : yield this.handleDrillDown({
|
|
131569
|
-
adcode:
|
|
131570
|
-
duration:
|
|
131571
|
-
saveBackCamvasState:
|
|
131577
|
+
adcode: s0,
|
|
131578
|
+
duration: d0,
|
|
131579
|
+
saveBackCamvasState: i0.includes(-1) ? !1 : this.options.handleBackKeepCamvasState,
|
|
131580
|
+
extrudelineBloom: t0
|
|
131572
131581
|
});
|
|
131573
131582
|
}
|
|
131574
131583
|
} catch ($e) {
|
|
@@ -131581,7 +131590,6 @@ const objs$4 = zi(ai({}, objs$5), {
|
|
|
131581
131590
|
throw qe[0];
|
|
131582
131591
|
}
|
|
131583
131592
|
}
|
|
131584
|
-
i0 && ((dt = (rt = this.map) == null ? void 0 : rt.extrudelineArr) != null && dt[0]) && (this.map.extrudelineArr[0].object3d.userData.bloom = n0);
|
|
131585
131593
|
}
|
|
131586
131594
|
});
|
|
131587
131595
|
}
|
|
@@ -134018,7 +134026,7 @@ const objs = zi(ai({}, objs$5), {
|
|
|
134018
134026
|
}
|
|
134019
134027
|
initVis() {
|
|
134020
134028
|
return q0(this, null, function* () {
|
|
134021
|
-
yield Promise.all([
|
|
134029
|
+
const [s, r] = yield Promise.all([
|
|
134022
134030
|
this.drawController.draw("Light", {
|
|
134023
134031
|
type: "PointLight",
|
|
134024
134032
|
intensity: 4,
|
|
@@ -134028,6 +134036,7 @@ const objs = zi(ai({}, objs$5), {
|
|
|
134028
134036
|
}),
|
|
134029
134037
|
this.drawController.draw("Earth")
|
|
134030
134038
|
]);
|
|
134039
|
+
yield this.pencil.controls.fitToBox(r.object3d, !1), s.position.copy(this.pencil.cameraPositon);
|
|
134031
134040
|
});
|
|
134032
134041
|
}
|
|
134033
134042
|
show() {
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.24.
|
|
1
|
+
declare const _default: "0.24.4";
|
|
2
2
|
export default _default;
|
package/dist/vis/base/index.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ export default class Base extends Event {
|
|
|
73
73
|
editor?: Editor;
|
|
74
74
|
tier0: boolean;
|
|
75
75
|
constructor(options: BaseOptions);
|
|
76
|
+
cameraState: Record<string, number[]>;
|
|
76
77
|
setOptions(options: Record<string, any>): void;
|
|
77
78
|
_baseObjectByUuid: Editor['baseObjectByUuid'];
|
|
78
79
|
get fromJSON(): (jsonOrUrl: Record<string, any> | string, hooks?: Record<string, any>) => Promise<Record<string, any>>;
|
|
@@ -98,6 +99,8 @@ export default class Base extends Event {
|
|
|
98
99
|
mouseButtonsActiveStore: Record<string, any> | null;
|
|
99
100
|
initSettings(): void;
|
|
100
101
|
handleSetting(key: string, value: any): Promise<any>;
|
|
102
|
+
setSaveCamera(type: string): void;
|
|
103
|
+
useSaveCamera(type: string, enableTransition?: boolean): Promise<boolean>;
|
|
101
104
|
show(): void;
|
|
102
105
|
hide(): void;
|
|
103
106
|
addCSS2D(dom: HTMLElement, options?: {
|
package/dist/vis/map/index.d.ts
CHANGED
|
@@ -25,7 +25,6 @@ export interface MapOptions extends BaseOptions {
|
|
|
25
25
|
geojsonMap?: Record<string, GeoJSON>;
|
|
26
26
|
extrudeLineGeojsonMap?: Record<string, GeoJSON>;
|
|
27
27
|
bboxMap?: Record<string, number[]>;
|
|
28
|
-
lookAtMap?: Record<string, [number, number, number, number, number, number]>;
|
|
29
28
|
fixGeojson?: Record<string, string>;
|
|
30
29
|
plateInCenter?: boolean;
|
|
31
30
|
clickHandleDrillDown?: boolean;
|
|
@@ -173,10 +172,11 @@ export default class extends Base {
|
|
|
173
172
|
y: number;
|
|
174
173
|
} | undefined;
|
|
175
174
|
booleanPointInCn(location: [number, number]): boolean;
|
|
176
|
-
handleDrillDown({ adcode, duration, saveBackCamvasState, }: {
|
|
175
|
+
handleDrillDown({ adcode, duration, saveBackCamvasState, extrudelineBloom, }: {
|
|
177
176
|
adcode: number;
|
|
178
177
|
duration?: number;
|
|
179
178
|
saveBackCamvasState?: boolean;
|
|
179
|
+
extrudelineBloom?: boolean;
|
|
180
180
|
}): Promise<void>;
|
|
181
181
|
saveBackCamvasState(index: number): void;
|
|
182
182
|
fixNear(adcode: number): void;
|
|
@@ -187,12 +187,13 @@ export default class extends Base {
|
|
|
187
187
|
enableTransition?: boolean;
|
|
188
188
|
}): Promise<void>;
|
|
189
189
|
paddingInCssPixel(obj: BaseObject, top: number, right: number, bottom: number, left: number, enableTransition: boolean): Promise<void[]>;
|
|
190
|
-
drawPlaneMap({ geojson, extrudeLineGeojson, bbox, depth, adcode, }: {
|
|
190
|
+
drawPlaneMap({ geojson, extrudeLineGeojson, bbox, depth, extrudelineBloom, adcode, }: {
|
|
191
191
|
geojson: GeoJSON;
|
|
192
192
|
extrudeLineGeojson?: GeoJSON;
|
|
193
193
|
bbox?: number[];
|
|
194
194
|
depth: number;
|
|
195
195
|
adcode: number;
|
|
196
|
+
extrudelineBloom?: boolean;
|
|
196
197
|
}): Promise<PlaneMap>;
|
|
197
198
|
handleBack({ duration, handleLookBack, keepOne, }?: {
|
|
198
199
|
duration?: number | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vis-core",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.4",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"start": "npm run version && PORT=5173 bundler-dev",
|
|
6
6
|
"build:site": "npm run version && bundler",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"esus-lite": "^0.2.8",
|
|
69
69
|
"events": "^3.3.0",
|
|
70
70
|
"geojson-cn": "^0.1.30",
|
|
71
|
-
"gl-draw": "0.12.
|
|
71
|
+
"gl-draw": "0.12.10",
|
|
72
72
|
"jsrsasign": "^11.1.0",
|
|
73
73
|
"lodash-es": "^4.17.21"
|
|
74
74
|
},
|