vis-core 0.21.9 → 0.21.10
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 +5 -5
- package/dist/index.module.js +39 -17
- package/dist/version.d.ts +1 -1
- package/dist/vis/all/MaterialList.d.ts +1 -0
- package/dist/vis/map/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.module.js
CHANGED
|
@@ -31222,21 +31222,27 @@ var doEval = function c(e) {
|
|
|
31222
31222
|
}
|
|
31223
31223
|
}
|
|
31224
31224
|
return Re;
|
|
31225
|
-
},
|
|
31226
|
-
|
|
31227
|
-
|
|
31228
|
-
|
|
31229
|
-
|
|
31230
|
-
|
|
31231
|
-
|
|
31232
|
-
|
|
31225
|
+
}, esDefineProperty, hasRequiredEsDefineProperty;
|
|
31226
|
+
function requireEsDefineProperty() {
|
|
31227
|
+
if (hasRequiredEsDefineProperty) return esDefineProperty;
|
|
31228
|
+
hasRequiredEsDefineProperty = 1;
|
|
31229
|
+
var c = getIntrinsic, e = c("%Object.defineProperty%", !0) || !1;
|
|
31230
|
+
if (e)
|
|
31231
|
+
try {
|
|
31232
|
+
e({}, "a", { value: 1 });
|
|
31233
|
+
} catch (s) {
|
|
31234
|
+
e = !1;
|
|
31235
|
+
}
|
|
31236
|
+
return esDefineProperty = e, esDefineProperty;
|
|
31237
|
+
}
|
|
31238
|
+
var GetIntrinsic$8 = getIntrinsic, $gOPD$1 = GetIntrinsic$8("%Object.getOwnPropertyDescriptor%", !0);
|
|
31233
31239
|
if ($gOPD$1)
|
|
31234
31240
|
try {
|
|
31235
31241
|
$gOPD$1([], "length");
|
|
31236
31242
|
} catch (c) {
|
|
31237
31243
|
$gOPD$1 = null;
|
|
31238
31244
|
}
|
|
31239
|
-
var gopd$1 = $gOPD$1, $defineProperty$2 =
|
|
31245
|
+
var gopd$1 = $gOPD$1, $defineProperty$2 = requireEsDefineProperty(), $SyntaxError$1 = syntax, $TypeError$5 = type, gopd = gopd$1, defineDataProperty$1 = function(e, s, h) {
|
|
31240
31246
|
if (!e || typeof e != "object" && typeof e != "function")
|
|
31241
31247
|
throw new $TypeError$5("`obj` must be an object or a function`");
|
|
31242
31248
|
if (typeof s != "string" && typeof s != "symbol")
|
|
@@ -31297,7 +31303,7 @@ var hasPropertyDescriptors_1$1 = hasPropertyDescriptors$2, keys$1 = objectKeys$2
|
|
|
31297
31303
|
defineProperty$2(c, h[Y], e[h[Y]], s[h[Y]]);
|
|
31298
31304
|
};
|
|
31299
31305
|
defineProperties$2.supportsDescriptors = !!supportsDescriptors$3;
|
|
31300
|
-
var defineProperties_1$1 = defineProperties$2, callBind$6 = { exports: {} }, $defineProperty =
|
|
31306
|
+
var defineProperties_1$1 = defineProperties$2, callBind$6 = { exports: {} }, $defineProperty = requireEsDefineProperty(), hasPropertyDescriptors$1 = function() {
|
|
31301
31307
|
return !!$defineProperty;
|
|
31302
31308
|
};
|
|
31303
31309
|
hasPropertyDescriptors$1.hasArrayLengthDefineBug = function() {
|
|
@@ -31334,7 +31340,7 @@ var hasPropertyDescriptors_1 = hasPropertyDescriptors$1, GetIntrinsic$6 = getInt
|
|
|
31334
31340
|
)), e;
|
|
31335
31341
|
};
|
|
31336
31342
|
(function(c) {
|
|
31337
|
-
var e = functionBind, s = getIntrinsic, h = setFunctionLength, Y = type, Ge = s("%Function.prototype.apply%"), We = s("%Function.prototype.call%"), Re = s("%Reflect.apply%", !0) || e.call(We, Ge), Le =
|
|
31343
|
+
var e = functionBind, s = getIntrinsic, h = setFunctionLength, Y = type, Ge = s("%Function.prototype.apply%"), We = s("%Function.prototype.call%"), Re = s("%Reflect.apply%", !0) || e.call(We, Ge), Le = requireEsDefineProperty(), ve = s("%Math.max%");
|
|
31338
31344
|
c.exports = function(ke) {
|
|
31339
31345
|
if (typeof ke != "function")
|
|
31340
31346
|
throw new Y("a function is required");
|
|
@@ -37242,6 +37248,11 @@ class MaterialList {
|
|
|
37242
37248
|
emitObject3dChange() {
|
|
37243
37249
|
this.pencil.event.emit("object3dListChange");
|
|
37244
37250
|
}
|
|
37251
|
+
setObject3dMeta(e, s) {
|
|
37252
|
+
this.objectList.forEach((h, Y) => {
|
|
37253
|
+
h.key === e && this.objectList.set(Y, xi(xi({}, h), s));
|
|
37254
|
+
});
|
|
37255
|
+
}
|
|
37245
37256
|
setObject3d(e, s, h) {
|
|
37246
37257
|
if (this.objectList.has(e) && console.warn(`ObjectList: ${e.uuid} already exists`), !(h != null && h.disableCheckHide)) {
|
|
37247
37258
|
const Y = e.material;
|
|
@@ -47192,7 +47203,7 @@ function createAreaLightMaterial(c) {
|
|
|
47192
47203
|
const e = new MeshBasicMaterial();
|
|
47193
47204
|
return e.color.setScalar(c), e;
|
|
47194
47205
|
}
|
|
47195
|
-
const version = "0.21.
|
|
47206
|
+
const version = "0.21.10";
|
|
47196
47207
|
class Event {
|
|
47197
47208
|
constructor() {
|
|
47198
47209
|
F0(this, "event", new EventEmitter());
|
|
@@ -49182,7 +49193,7 @@ class ContinentsBg extends D$1 {
|
|
|
49182
49193
|
create() {
|
|
49183
49194
|
return $0(this, null, function* () {
|
|
49184
49195
|
const { depth: s } = this.options, h = this.pencil.installPlugins.get("materialList"), Y = this.pencil.getPlugin("draw"), Ge = h.getMaterialObj("continents");
|
|
49185
|
-
this.createGroup(), yield Promise.all(
|
|
49196
|
+
this.createGroup(), this.object3d.name = "大洲组", yield Promise.all(
|
|
49186
49197
|
continents.features.map((We) => $0(this, null, function* () {
|
|
49187
49198
|
const Re = We.properties.name;
|
|
49188
49199
|
Re === "大洋洲" && (We.geometry.coordinates[4] = [], We.geometry.coordinates[21] = []);
|
|
@@ -49242,8 +49253,13 @@ class ContinentsBg extends D$1 {
|
|
|
49242
49253
|
}), this.mapArr.forEach((h) => {
|
|
49243
49254
|
s.setObject3d(h.object3d, "continents-" + h.userData.name, {
|
|
49244
49255
|
baseObject: h,
|
|
49245
|
-
remove: !1
|
|
49256
|
+
remove: !1,
|
|
49257
|
+
parent: this.object3d
|
|
49246
49258
|
});
|
|
49259
|
+
}), s.setObject3dMeta("continentsArea", {
|
|
49260
|
+
parent: this.object3d
|
|
49261
|
+
}), s.setObject3dMeta("continentsLine", {
|
|
49262
|
+
parent: this.object3d
|
|
49247
49263
|
});
|
|
49248
49264
|
}
|
|
49249
49265
|
dispose() {
|
|
@@ -49730,10 +49746,10 @@ const objs$4 = sn(xi({}, objs$5), {
|
|
|
49730
49746
|
"continentsArea",
|
|
49731
49747
|
["continents#topMat", "continents#sideMat"],
|
|
49732
49748
|
{
|
|
49733
|
-
name: "
|
|
49749
|
+
name: "板块材质"
|
|
49734
49750
|
}
|
|
49735
49751
|
), this.mList.setShowMaterialList("continentsLine", "continents#lineMat", {
|
|
49736
|
-
name: "
|
|
49752
|
+
name: "线材质"
|
|
49737
49753
|
});
|
|
49738
49754
|
}
|
|
49739
49755
|
});
|
|
@@ -49931,7 +49947,13 @@ const objs$4 = sn(xi({}, objs$5), {
|
|
|
49931
49947
|
getDepth(s) {
|
|
49932
49948
|
const h = this.getAdcodeShowLevel(s);
|
|
49933
49949
|
let Y = this.options.mapDepth;
|
|
49934
|
-
|
|
49950
|
+
Array.isArray(Y) || (Y = new Array(3).fill(Y));
|
|
49951
|
+
let Ge;
|
|
49952
|
+
if (h === "country" ? Ge = Y[0] : h === "province" ? Ge = Y[1] : Ge = Y[2], this.options.depthReference && this.options.bboxMap[s]) {
|
|
49953
|
+
const We = this.options.depthReference, Re = this.options.bboxMap[s], Le = Math.abs(Re[3] - Re[1]) / Math.abs(We[3] - We[1]), ve = Math.abs(Re[2] - Re[0]) / Math.abs(We[2] - We[0]);
|
|
49954
|
+
Ge = Ge * Math.max(Le, ve);
|
|
49955
|
+
}
|
|
49956
|
+
return Ge;
|
|
49935
49957
|
}
|
|
49936
49958
|
getAdcodeShowLevel(s) {
|
|
49937
49959
|
var h;
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.21.
|
|
1
|
+
declare const _default: "0.21.10";
|
|
2
2
|
export default _default;
|
|
@@ -32,6 +32,7 @@ export default class MaterialList {
|
|
|
32
32
|
}): void;
|
|
33
33
|
getValidShowObjectListArr(): Meta[];
|
|
34
34
|
emitObject3dChange(): void;
|
|
35
|
+
setObject3dMeta(key: string, meta: ObjectMeta): void;
|
|
35
36
|
setObject3d(object3d: THREE.Object3D, key: string, meta?: ObjectMeta & {
|
|
36
37
|
disableCheckHide?: boolean;
|
|
37
38
|
}): void;
|
package/dist/vis/map/index.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface MapOptions extends BaseOptions {
|
|
|
20
20
|
continentsBgDepth?: number;
|
|
21
21
|
clickOusideBack?: boolean;
|
|
22
22
|
mapDepth?: number[];
|
|
23
|
+
depthReference?: number[];
|
|
23
24
|
mapPadding?: number[];
|
|
24
25
|
geojsonMap?: Record<string, GeoJSON>;
|
|
25
26
|
extrudeLineGeojsonMap?: Record<string, GeoJSON>;
|