vis-core 0.22.12 → 0.22.13
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.d.ts +1 -1
- package/dist/index.js +5 -5
- package/dist/index.module.js +63 -42
- package/dist/version.d.ts +1 -1
- package/dist/vis/map/index.d.ts +3 -0
- package/dist/vis/map/objects/PlaneMap.d.ts +1 -1
- package/dist/vis/map2/index.d.ts +1 -0
- package/dist/vis/map2/map.d.ts +0 -1
- package/package.json +1 -1
package/dist/index.module.js
CHANGED
|
@@ -90,7 +90,7 @@ const publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRz
|
|
|
90
90
|
).toString(CryptoJS.enc.Utf8), qe = JSON.parse($e), st = Date.now();
|
|
91
91
|
return !qe.s || qe.s > st ? (this.token = void 0, "") : qe.e && qe.e < st ? (this.token = void 0, "") : (qe.isValid = Qe, qe);
|
|
92
92
|
}
|
|
93
|
-
}, version = "0.22.
|
|
93
|
+
}, version = "0.22.13";
|
|
94
94
|
/**
|
|
95
95
|
* @license
|
|
96
96
|
* Copyright 2010-2024 Three.js Authors
|
|
@@ -129382,9 +129382,11 @@ let PlaneMap$1 = class extends A$1 {
|
|
|
129382
129382
|
!Xe || !Xe.uniforms.lineLightAnimation.value || (Xe.uniforms.time.value = r);
|
|
129383
129383
|
});
|
|
129384
129384
|
}
|
|
129385
|
-
findGroup(s) {
|
|
129385
|
+
findGroup(s, r = !1) {
|
|
129386
129386
|
return this.pencil.getPlugin("draw").getObject("Group", {
|
|
129387
|
-
key: `area-group-${
|
|
129387
|
+
key: `area-group-${r ? this.getPropertiesKey({
|
|
129388
|
+
adcode: s
|
|
129389
|
+
}) : s}`
|
|
129388
129390
|
});
|
|
129389
129391
|
}
|
|
129390
129392
|
setAreaMaterial(s, r) {
|
|
@@ -129771,16 +129773,19 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
129771
129773
|
name: "顶面",
|
|
129772
129774
|
map: e.getAsset("/image/map/hp.webp"),
|
|
129773
129775
|
normalMap: e.getAsset("/image/map/shuchu2.webp")
|
|
129774
|
-
}), T = new MeshBasicMaterial({
|
|
129776
|
+
}), T = this.options.drillDownTopMatTwo ? new MeshBasicMaterial({
|
|
129777
|
+
name: "二级顶面",
|
|
129778
|
+
color: new Color$1("#0d2425")
|
|
129779
|
+
}) : null, de = new MeshBasicMaterial({
|
|
129775
129780
|
name: "侧面",
|
|
129776
129781
|
map: e.getAsset("/image/map/jianbian.webp")
|
|
129777
|
-
}),
|
|
129782
|
+
}), Xe = new it$1({
|
|
129778
129783
|
color: new Color$1("#73FEDD"),
|
|
129779
129784
|
sizeAttenuation: 0,
|
|
129780
129785
|
lineWidth: this.options.lineWidth,
|
|
129781
129786
|
//@ts-ignore
|
|
129782
129787
|
depthWrite: !1
|
|
129783
|
-
}),
|
|
129788
|
+
}), Ke = new it$1({
|
|
129784
129789
|
name: "板块边线",
|
|
129785
129790
|
color: new Color$1("#00FFED"),
|
|
129786
129791
|
sizeAttenuation: 0,
|
|
@@ -129790,9 +129795,10 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
129790
129795
|
});
|
|
129791
129796
|
return {
|
|
129792
129797
|
topMat: r,
|
|
129793
|
-
|
|
129794
|
-
|
|
129795
|
-
|
|
129798
|
+
topMatTwo: T,
|
|
129799
|
+
sideMat: de,
|
|
129800
|
+
lineMat: Xe,
|
|
129801
|
+
extrudeLineMat: Ke
|
|
129796
129802
|
};
|
|
129797
129803
|
})();
|
|
129798
129804
|
this.mList.setMaterialObj("plane", s), this.mList.setShowMaterialList("area", ["plane#topMat", "plane#sideMat"], {
|
|
@@ -129813,16 +129819,19 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
129813
129819
|
const r = new MeshBasicMaterial({
|
|
129814
129820
|
name: "顶面",
|
|
129815
129821
|
color: new Color$1("#0d2425")
|
|
129816
|
-
}), T = new MeshBasicMaterial({
|
|
129822
|
+
}), T = this.options.drillDownTopMatTwo ? new MeshBasicMaterial({
|
|
129823
|
+
name: "二级顶面",
|
|
129824
|
+
color: new Color$1("#0d2425")
|
|
129825
|
+
}) : null, de = new MeshBasicMaterial({
|
|
129817
129826
|
name: "侧面",
|
|
129818
129827
|
map: e.getAsset("/image/map/jianbian.webp")
|
|
129819
|
-
}),
|
|
129828
|
+
}), Xe = new it$1({
|
|
129820
129829
|
color: new Color$1("#73FEDD"),
|
|
129821
129830
|
sizeAttenuation: 0,
|
|
129822
129831
|
lineWidth: this.options.lineWidth,
|
|
129823
129832
|
//@ts-ignore
|
|
129824
129833
|
depthWrite: !1
|
|
129825
|
-
}),
|
|
129834
|
+
}), Ke = new it$1({
|
|
129826
129835
|
color: new Color$1("#00FFED"),
|
|
129827
129836
|
sizeAttenuation: 0,
|
|
129828
129837
|
lineWidth: this.options.extrudeLineWidth,
|
|
@@ -129830,10 +129839,11 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
129830
129839
|
depthWrite: !1
|
|
129831
129840
|
});
|
|
129832
129841
|
return {
|
|
129842
|
+
topMatTwo: T,
|
|
129833
129843
|
topMat: r,
|
|
129834
|
-
sideMat:
|
|
129835
|
-
lineMat:
|
|
129836
|
-
extrudeLineMat:
|
|
129844
|
+
sideMat: de,
|
|
129845
|
+
lineMat: Xe,
|
|
129846
|
+
extrudeLineMat: Ke
|
|
129837
129847
|
};
|
|
129838
129848
|
})();
|
|
129839
129849
|
this.mList.setMaterialObj("plane", s), this.mList.setShowMaterialList("area", ["plane#topMat", "plane#sideMat"], {
|
|
@@ -129879,7 +129889,7 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
129879
129889
|
H0(this, "pscale", 5e4 / 1e3);
|
|
129880
129890
|
H0(this, "meters");
|
|
129881
129891
|
H0(this, "extendsOptions", {
|
|
129882
|
-
mapDepth: () => this.
|
|
129892
|
+
mapDepth: () => this.getOptionsDepth(this.options.adcode),
|
|
129883
129893
|
equirectangular: () => this.options.projectionType === "equirectangular",
|
|
129884
129894
|
// fahey: () => {
|
|
129885
129895
|
// return this.options.projectionType === 'fahey';
|
|
@@ -129948,6 +129958,8 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
129948
129958
|
continentsBgDepth: 0,
|
|
129949
129959
|
parentBgDepth: 0,
|
|
129950
129960
|
parentBgTopSegments: 0,
|
|
129961
|
+
clickHandleDrillDown: !1,
|
|
129962
|
+
drillDownTopMatTwo: !1,
|
|
129951
129963
|
clickOusideBack: !0,
|
|
129952
129964
|
mapDepth: [1, 0.4, 0.2],
|
|
129953
129965
|
mapPadding: [100, 100, 100, 100],
|
|
@@ -129976,7 +129988,7 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
129976
129988
|
geojsonMap: r,
|
|
129977
129989
|
extrudeLineGeojsonMap: T,
|
|
129978
129990
|
bboxMap: de
|
|
129979
|
-
})), this.options.equirectangular && (this.options.projectionType = "equirectangular"), this.options.fahey && (this.options.projectionType = "fahey", this.pscale = 100, this.pcenter = [0, 0]), this.pencilConfig = PENCIL_CONFIG$4, (this.getAdcodeShowLevel(this.options.adcode) === "province" || this.getAdcodeShowLevel(this.options.adcode) === "country") && (this.extendsOptions.parentBg = () => this.options.parentBg, this.extendsOptions.parentBgDepth = () => this.options.parentBgDepth, this.extendsOptions.parentBgTopSegments = () => this.options.parentBgTopSegments, this.extendsOptions.continentsBg = () => this.options.continentsBg, this.extendsOptions.continentsBgDepth = () => this.options.continentsBgDepth), this.options.adcode === 0 ? world(this) : this.options.style === "map2" || (this.options.adcode === 1e5 ? china(this) : base$1(this));
|
|
129991
|
+
})), this.options.equirectangular && (this.options.projectionType = "equirectangular"), this.options.fahey && (this.options.projectionType = "fahey", this.pscale = 100, this.pcenter = [0, 0]), this.pencilConfig = PENCIL_CONFIG$4, (this.getAdcodeShowLevel(this.options.adcode) === "province" || this.getAdcodeShowLevel(this.options.adcode) === "country") && (this.options.clickHandleDrillDown && (this.extendsOptions.mapDepth = () => Array.isArray(this.options.mapDepth) ? this.options.mapDepth : new Array(3).fill(this.options.mapDepth)), this.extendsOptions.clickHandleDrillDown = () => this.options.clickHandleDrillDown, this.extendsOptions.drillDownTopMatTwo = () => this.options.drillDownTopMatTwo, this.extendsOptions.drillDownPlateInCenter = () => this.options.drillDownPlateInCenter, this.extendsOptions.parentBg = () => this.options.parentBg, this.extendsOptions.parentBgDepth = () => this.options.parentBgDepth, this.extendsOptions.parentBgTopSegments = () => this.options.parentBgTopSegments, this.extendsOptions.continentsBg = () => this.options.continentsBg, this.extendsOptions.continentsBgDepth = () => this.options.continentsBgDepth), this.options.adcode === 0 ? world(this) : this.options.style === "map2" || (this.options.adcode === 1e5 ? china(this) : base$1(this));
|
|
129980
129992
|
}
|
|
129981
129993
|
handleSetting(s, r) {
|
|
129982
129994
|
return ei(this, null, function* () {
|
|
@@ -130022,7 +130034,9 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
130022
130034
|
scale: this.pscale,
|
|
130023
130035
|
projectionType: this.options.projectionType,
|
|
130024
130036
|
rotate: this.options.worldPacificCentre ? [-160, 0] : void 0
|
|
130025
|
-
}), this.meters = this.projection([1 * 1141e-8 + this.pcenter[0], 0])[0], yield this.initPencil(), console.time(`vis-core:time.${this.visName}-loader`), this.loaderAdd(), console.timeEnd(`vis-core:time.${this.visName}-loader`), yield this.loader.loadAll(), this.group = yield this.drawController.draw("Group"), yield this.initMaterial(), yield this.initVis(s),
|
|
130037
|
+
}), this.meters = this.projection([1 * 1141e-8 + this.pcenter[0], 0])[0], yield this.initPencil(), console.time(`vis-core:time.${this.visName}-loader`), this.loaderAdd(), console.timeEnd(`vis-core:time.${this.visName}-loader`), yield this.loader.loadAll(), this.group = yield this.drawController.draw("Group"), yield this.initMaterial(), yield this.initVis(s), this.options.clickHandleDrillDown && this.addListener(this.container, "click", (r) => {
|
|
130038
|
+
this.handleClick(r);
|
|
130039
|
+
}), yield Promise.all(this.drawController.objectsPromise);
|
|
130026
130040
|
});
|
|
130027
130041
|
}
|
|
130028
130042
|
initVis(s) {
|
|
@@ -130361,19 +130375,23 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
130361
130375
|
shadowMapDisabled() {
|
|
130362
130376
|
this.pencil.scene.userData.shadowMapEnabled && (this.pencil.scene.userData.shadowMapEnabled = !1, this.shadowMapLight && (this.shadowMapLight.erase(), this.mList.delObject3d(this.shadowMapLight.object3d), this.shadowMapLight = void 0), this.planeShadow && (this.mList.delObject3d(this.planeShadow.object3d), this.planeShadow.erase(), this.planeShadow = void 0));
|
|
130363
130377
|
}
|
|
130378
|
+
getOptionsDepth(s) {
|
|
130379
|
+
const r = this.getAdcodeShowLevel(s);
|
|
130380
|
+
let T = this.options.mapDepth;
|
|
130381
|
+
Array.isArray(T) || (T = new Array(3).fill(T));
|
|
130382
|
+
let de;
|
|
130383
|
+
return r === "country" ? de = T[0] : r === "province" ? de = T[1] : de = T[2], de;
|
|
130384
|
+
}
|
|
130364
130385
|
getDepth(s, r) {
|
|
130365
|
-
|
|
130366
|
-
|
|
130367
|
-
|
|
130368
|
-
|
|
130369
|
-
if (T === "country" ? Xe = de[0] : T === "province" ? Xe = de[1] : Xe = de[2], this.options.depthReference && this.options.bboxMap[s]) {
|
|
130370
|
-
const Ke = this.options.depthReference, Je = this.options.bboxMap[s];
|
|
130371
|
-
Xe = Xe * this.getReferenceScale(Ke, Je);
|
|
130386
|
+
let T = this.getOptionsDepth(s);
|
|
130387
|
+
if (this.options.depthReference && this.options.bboxMap[s]) {
|
|
130388
|
+
const de = this.options.depthReference, Xe = this.options.bboxMap[s];
|
|
130389
|
+
T = T * this.getReferenceScale(de, Xe);
|
|
130372
130390
|
} else if (this.mapHistory.length && this.options.bboxMap[this.mapHistory[0].mapInfo.adcode]) {
|
|
130373
|
-
const
|
|
130374
|
-
|
|
130391
|
+
const de = this.options.bboxMap[this.mapHistory[0].mapInfo.adcode], Xe = bbox(r), Ke = this.getReferenceScale(de, Xe);
|
|
130392
|
+
T = T * Ke;
|
|
130375
130393
|
}
|
|
130376
|
-
return
|
|
130394
|
+
return T;
|
|
130377
130395
|
}
|
|
130378
130396
|
getReferenceScale(s, r) {
|
|
130379
130397
|
const T = Math.abs(r[3] - r[1]) / Math.abs(s[3] - s[1]), de = Math.abs(r[2] - r[0]) / Math.abs(s[2] - s[0]);
|
|
@@ -130491,7 +130509,7 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
130491
130509
|
}) {
|
|
130492
130510
|
var Xe, Ke, Je, Qe, _e, $e, qe, st;
|
|
130493
130511
|
if (typeof s != "undefined" && !this.isAnimating) {
|
|
130494
|
-
const dt = (Xe = this.map) == null ? void 0 : Xe.findGroup(s), Wt = findLevelJsonItem2(+s);
|
|
130512
|
+
const dt = (Xe = this.map) == null ? void 0 : Xe.findGroup(s, !0), Wt = findLevelJsonItem2(+s);
|
|
130495
130513
|
if (this.isAnimating || !Wt) return;
|
|
130496
130514
|
this.isAnimating = !0;
|
|
130497
130515
|
const { name: Yt } = Wt;
|
|
@@ -130641,7 +130659,9 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
130641
130659
|
depth: de,
|
|
130642
130660
|
adcode: Xe
|
|
130643
130661
|
}) {
|
|
130644
|
-
const Je = this.mList.getMaterialObj("plane"),
|
|
130662
|
+
const Je = this.mapHistory.length === 0, Qe = this.mList.getMaterialObj("plane"), _e = ai({}, Qe);
|
|
130663
|
+
!Je && _e.topMatTwo && (_e.topMat = _e.topMatTwo);
|
|
130664
|
+
const $e = yield this.drawController.draw(
|
|
130645
130665
|
"PlaneMap",
|
|
130646
130666
|
{
|
|
130647
130667
|
geojson: s,
|
|
@@ -130653,7 +130673,7 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
130653
130673
|
rotate: this.options.worldPacificCentre ? [-160, 0] : void 0,
|
|
130654
130674
|
projectionType: this.options.projectionType
|
|
130655
130675
|
},
|
|
130656
|
-
materialOptions:
|
|
130676
|
+
materialOptions: _e,
|
|
130657
130677
|
bbox: T,
|
|
130658
130678
|
topSegments: this.options.topSegments,
|
|
130659
130679
|
lineOffset: this.options.lineOffset,
|
|
@@ -130661,19 +130681,19 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
130661
130681
|
},
|
|
130662
130682
|
this.group
|
|
130663
130683
|
);
|
|
130664
|
-
return
|
|
130665
|
-
|
|
130666
|
-
baseObject:
|
|
130684
|
+
return $e.extrudelineArr && $e.extrudelineArr.forEach((qe) => {
|
|
130685
|
+
qe.object3d.name = "板块边线", this.mList.setObject3d(qe.object3d, "extrudeLine", {
|
|
130686
|
+
baseObject: qe,
|
|
130667
130687
|
replace: !0
|
|
130668
|
-
}), this.initBaseObjectUserData(
|
|
130688
|
+
}), this.initBaseObjectUserData(qe);
|
|
130669
130689
|
}), this.mList.setObject3d(
|
|
130670
|
-
|
|
130690
|
+
$e.object3d,
|
|
130671
130691
|
Xe === 1e5 ? "chinaGroup" : "planeMapGroup",
|
|
130672
130692
|
{
|
|
130673
|
-
baseObject:
|
|
130693
|
+
baseObject: $e,
|
|
130674
130694
|
replace: !0
|
|
130675
130695
|
}
|
|
130676
|
-
),
|
|
130696
|
+
), $e;
|
|
130677
130697
|
});
|
|
130678
130698
|
}
|
|
130679
130699
|
handleBack() {
|
|
@@ -130700,7 +130720,7 @@ const objs$4 = Ki(ai({}, objs$5), {
|
|
|
130700
130720
|
this.drawController.eraseWithoutMaterial(de.map), this.eraseLabels();
|
|
130701
130721
|
}
|
|
130702
130722
|
if (this.mapObj) {
|
|
130703
|
-
const { map: Xe } = this.mapObj, Ke = Xe == null ? void 0 : Xe.findGroup(de == null ? void 0 : de.mapInfo.adcode);
|
|
130723
|
+
const { map: Xe } = this.mapObj, Ke = Xe == null ? void 0 : Xe.findGroup(de == null ? void 0 : de.mapInfo.adcode, !0);
|
|
130704
130724
|
Ke && Ke.show(), Xe && r && (this.options.showOneLevel ? Xe.show() : Xe.active(), this.options.drillDownHideParent && this.parentBg.forEach((Je) => {
|
|
130705
130725
|
Je.show();
|
|
130706
130726
|
}), yield this.handleLookBack(s), this.drawLabels());
|
|
@@ -133081,9 +133101,7 @@ const R1 = class R1 extends Map$1 {
|
|
|
133081
133101
|
clip: !!this.options.cityOnMap,
|
|
133082
133102
|
grey: !1
|
|
133083
133103
|
});
|
|
133084
|
-
})), this.options.
|
|
133085
|
-
this.showGroup === "map" && this.handleClick(r);
|
|
133086
|
-
}), this.options.cityOnMap)
|
|
133104
|
+
})), this.options.cityOnMap)
|
|
133087
133105
|
if (this.options.allCity) {
|
|
133088
133106
|
const r = adcodeMap[this.mapInfo.adcode], T = r.level === "province" ? r.adcode : adcodeMap[this.mapInfo.adcode].parent, de = (s = allArr.find((Xe) => Xe.adcode === T)) == null ? void 0 : s.subAreas;
|
|
133089
133107
|
de && (yield Promise.all(
|
|
@@ -133095,6 +133113,9 @@ const R1 = class R1 extends Map$1 {
|
|
|
133095
133113
|
yield this.initCityOnMap(this.mapInfo.adcode);
|
|
133096
133114
|
});
|
|
133097
133115
|
}
|
|
133116
|
+
handleClick(s) {
|
|
133117
|
+
this.showGroup === "map" && super.handleClick(s);
|
|
133118
|
+
}
|
|
133098
133119
|
preInitCityVis() {
|
|
133099
133120
|
return ei(this, null, function* () {
|
|
133100
133121
|
const s = Object.keys(this.options.jsonNameObj);
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.22.
|
|
1
|
+
declare const _default: "0.22.13";
|
|
2
2
|
export default _default;
|
package/dist/vis/map/index.d.ts
CHANGED
|
@@ -28,9 +28,11 @@ export interface MapOptions extends BaseOptions {
|
|
|
28
28
|
lookAtMap?: Record<string, [number, number, number, number, number, number]>;
|
|
29
29
|
fixGeojson?: Record<string, string>;
|
|
30
30
|
plateInCenter?: boolean;
|
|
31
|
+
clickHandleDrillDown?: boolean;
|
|
31
32
|
drillDownPlateInCenter?: boolean;
|
|
32
33
|
drillDownHideParent?: boolean;
|
|
33
34
|
drillDownRestrictions?: 'city' | 'district';
|
|
35
|
+
drillDownTopMatTwo?: boolean;
|
|
34
36
|
showDistrict?: boolean;
|
|
35
37
|
showLabel?: boolean | 'lite';
|
|
36
38
|
lineWidth?: number;
|
|
@@ -146,6 +148,7 @@ export default class extends Base {
|
|
|
146
148
|
planeShadow?: BaseObject;
|
|
147
149
|
shadowMapEnabled(): Promise<void>;
|
|
148
150
|
shadowMapDisabled(): void;
|
|
151
|
+
getOptionsDepth(adcode: number): number;
|
|
149
152
|
getDepth(adcode: number, geojson: GeoJSON): number;
|
|
150
153
|
getReferenceScale(bboxa: number[], bboxb: number[]): number;
|
|
151
154
|
getAdcodeShowLevel(adcode: number): string | undefined;
|
|
@@ -72,7 +72,7 @@ export default class PlaneMap extends BaseObject {
|
|
|
72
72
|
}[];
|
|
73
73
|
pickArea(e: MouseEvent): import("gl-draw/dist/core/BaseObject").IBaseObject | undefined;
|
|
74
74
|
update(delta: number, elapsed: number): void;
|
|
75
|
-
findGroup(adcode: string | number): Group | undefined;
|
|
75
|
+
findGroup(adcode: string | number, fix?: boolean): Group | undefined;
|
|
76
76
|
setAreaMaterial(key: string, material: THREE.Material[] | THREE.Material): void;
|
|
77
77
|
useAreaMaterial(key: string): void;
|
|
78
78
|
setLineMaterial(key: string, material: THREE.Material): void;
|
package/dist/vis/map2/index.d.ts
CHANGED
|
@@ -38,6 +38,7 @@ export default class extends Map {
|
|
|
38
38
|
options: Required<MapCityOptions>;
|
|
39
39
|
setOptions(options: MapCityOptions): void;
|
|
40
40
|
init(): Promise<void>;
|
|
41
|
+
handleClick(e: MouseEvent): void;
|
|
41
42
|
preInitCityVis(): Promise<void>;
|
|
42
43
|
initCityVis(adcode: number, options?: {
|
|
43
44
|
clip?: boolean;
|
package/dist/vis/map2/map.d.ts
CHANGED