vis-core 0.30.0-beta.35 → 0.30.0-beta.37

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.
@@ -63,7 +63,7 @@ import { continentsCountriesIso2 } from "geojson-cn";
63
63
  Array.prototype.at || (Array.prototype.at = function(v) {
64
64
  return v < 0 && (v = this.length + v), this[v];
65
65
  });
66
- const version = "0.30.0-beta.35", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
66
+ const version = "0.30.0-beta.37", publicKeyPEM = "LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQklqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FROEFNSUlCQ2dLQ0FRRUEyTG1aVVQzVG9LZEVRRUdrdUU1QQo3dnlYTzRMM1Z6NDA5RFF2a2xzRHZ2SytNM2M2OGl4ZEVhZDZFcnZGS2FKQ1QrNTZNdU1XSXhUTnlDZDVQSkFGCjVYdzI4cW1iVkVCR3FGdXVIZTltSm5GUmRXN1NpK1Z1cTZvRWxwQkRkeEFIQ0dsWVVpU1R3WmhBbjJaVXJLSUYKd1J2c1k1bi9uWWNhZnl5QW9tRjhmNVRsTkpwS1JtbDU3WlRSWjBMdzdQRDFSeHFIbmJ0YWFETkpiSDV5eFd6cQpaVTBwQWhxMFNkNHdlOW1DUTJWWXc5czhtUERLbW4rU083eGovSUsrR1ZEaEJNOUpaZ3VIcGFZUGt3bWd5UkdwCkx6V0tHMkZULzJRalZUT1dRT09mRFVtVitDSVlsN1hVVlh1Q0toYWFNQ0ZVa1JQOHg4aEZucmNFeklHQ1JpM3IKK3dJREFRQUIKLS0tLS1FTkQgUFVCTElDIEtFWS0tLS0t", accessToken = {
67
67
  token: void 0,
68
68
  getInfo() {
69
69
  if (!this.token)
@@ -9066,7 +9066,7 @@ class BufferGeometry extends EventDispatcher {
9066
9066
  this.dispatchEvent({ type: "dispose" });
9067
9067
  }
9068
9068
  }
9069
- const _inverseMatrix$3 = /* @__PURE__ */ new Matrix4(), _ray$3 = /* @__PURE__ */ new Ray(), _sphere$6 = /* @__PURE__ */ new Sphere$1(), _sphereHitAt = /* @__PURE__ */ new Vector3(), _vA$1 = /* @__PURE__ */ new Vector3(), _vB$1 = /* @__PURE__ */ new Vector3(), _vC$1 = /* @__PURE__ */ new Vector3(), _tempA = /* @__PURE__ */ new Vector3(), _morphA = /* @__PURE__ */ new Vector3(), _intersectionPoint$1 = /* @__PURE__ */ new Vector3(), _intersectionPointWorld = /* @__PURE__ */ new Vector3();
9069
+ const _inverseMatrix$3 = /* @__PURE__ */ new Matrix4(), _ray$3$1 = /* @__PURE__ */ new Ray(), _sphere$6 = /* @__PURE__ */ new Sphere$1(), _sphereHitAt = /* @__PURE__ */ new Vector3(), _vA$1 = /* @__PURE__ */ new Vector3(), _vB$1 = /* @__PURE__ */ new Vector3(), _vC$1 = /* @__PURE__ */ new Vector3(), _tempA = /* @__PURE__ */ new Vector3(), _morphA = /* @__PURE__ */ new Vector3(), _intersectionPoint$1 = /* @__PURE__ */ new Vector3(), _intersectionPointWorld = /* @__PURE__ */ new Vector3();
9070
9070
  class Mesh extends Object3D {
9071
9071
  /**
9072
9072
  * Constructs a new mesh.
@@ -9127,7 +9127,7 @@ class Mesh extends Object3D {
9127
9127
  */
9128
9128
  raycast(e, r) {
9129
9129
  const o = this.geometry, V = this.material, le = this.matrixWorld;
9130
- V !== void 0 && (o.boundingSphere === null && o.computeBoundingSphere(), _sphere$6.copy(o.boundingSphere), _sphere$6.applyMatrix4(le), _ray$3.copy(e.ray).recast(e.near), !(_sphere$6.containsPoint(_ray$3.origin) === !1 && (_ray$3.intersectSphere(_sphere$6, _sphereHitAt) === null || _ray$3.origin.distanceToSquared(_sphereHitAt) > Ln(e.far - e.near, 2))) && (_inverseMatrix$3.copy(le).invert(), _ray$3.copy(e.ray).applyMatrix4(_inverseMatrix$3), !(o.boundingBox !== null && _ray$3.intersectsBox(o.boundingBox) === !1) && this._computeIntersections(e, r, _ray$3)));
9130
+ V !== void 0 && (o.boundingSphere === null && o.computeBoundingSphere(), _sphere$6.copy(o.boundingSphere), _sphere$6.applyMatrix4(le), _ray$3$1.copy(e.ray).recast(e.near), !(_sphere$6.containsPoint(_ray$3$1.origin) === !1 && (_ray$3$1.intersectSphere(_sphere$6, _sphereHitAt) === null || _ray$3$1.origin.distanceToSquared(_sphereHitAt) > Ln(e.far - e.near, 2))) && (_inverseMatrix$3.copy(le).invert(), _ray$3$1.copy(e.ray).applyMatrix4(_inverseMatrix$3), !(o.boundingBox !== null && _ray$3$1.intersectsBox(o.boundingBox) === !1) && this._computeIntersections(e, r, _ray$3$1)));
9131
9131
  }
9132
9132
  _computeIntersections(e, r, o) {
9133
9133
  let V;
@@ -12119,7 +12119,7 @@ class LineBasicMaterial extends Material {
12119
12119
  return super.copy(e), this.color.copy(e.color), this.map = e.map, this.linewidth = e.linewidth, this.linecap = e.linecap, this.linejoin = e.linejoin, this.fog = e.fog, this;
12120
12120
  }
12121
12121
  }
12122
- const _vStart = /* @__PURE__ */ new Vector3(), _vEnd = /* @__PURE__ */ new Vector3(), _inverseMatrix$1 = /* @__PURE__ */ new Matrix4(), _ray$1$1 = /* @__PURE__ */ new Ray(), _sphere$1 = /* @__PURE__ */ new Sphere$1(), _intersectPointOnRay = /* @__PURE__ */ new Vector3(), _intersectPointOnSegment = /* @__PURE__ */ new Vector3();
12122
+ const _vStart = /* @__PURE__ */ new Vector3(), _vEnd = /* @__PURE__ */ new Vector3(), _inverseMatrix$1 = /* @__PURE__ */ new Matrix4(), _ray$1$1 = /* @__PURE__ */ new Ray(), _sphere$1$1 = /* @__PURE__ */ new Sphere$1(), _intersectPointOnRay = /* @__PURE__ */ new Vector3(), _intersectPointOnSegment = /* @__PURE__ */ new Vector3();
12123
12123
  class Line extends Object3D {
12124
12124
  /**
12125
12125
  * Constructs a new line.
@@ -12159,7 +12159,7 @@ class Line extends Object3D {
12159
12159
  */
12160
12160
  raycast(e, r) {
12161
12161
  const o = this.geometry, V = this.matrixWorld, le = e.params.Line.threshold, fe = o.drawRange;
12162
- if (o.boundingSphere === null && o.computeBoundingSphere(), _sphere$1.copy(o.boundingSphere), _sphere$1.applyMatrix4(V), _sphere$1.radius += le, e.ray.intersectsSphere(_sphere$1) === !1) return;
12162
+ if (o.boundingSphere === null && o.computeBoundingSphere(), _sphere$1$1.copy(o.boundingSphere), _sphere$1$1.applyMatrix4(V), _sphere$1$1.radius += le, e.ray.intersectsSphere(_sphere$1$1) === !1) return;
12163
12163
  _inverseMatrix$1.copy(V).invert(), _ray$1$1.copy(e.ray).applyMatrix4(_inverseMatrix$1);
12164
12164
  const Le = le / ((this.scale.x + this.scale.y + this.scale.z) / 3), Ce = Le * Le, Re = this.isLineSegments ? 2 : 1, Pe = o.index, Fe = o.attributes.position;
12165
12165
  if (Pe !== null) {
@@ -12271,7 +12271,7 @@ class PointsMaterial extends Material {
12271
12271
  return super.copy(e), this.color.copy(e.color), this.map = e.map, this.alphaMap = e.alphaMap, this.size = e.size, this.sizeAttenuation = e.sizeAttenuation, this.fog = e.fog, this;
12272
12272
  }
12273
12273
  }
12274
- const _inverseMatrix = /* @__PURE__ */ new Matrix4(), _ray$4 = /* @__PURE__ */ new Ray(), _sphere$7 = /* @__PURE__ */ new Sphere$1(), _position$2 = /* @__PURE__ */ new Vector3();
12274
+ const _inverseMatrix$4 = /* @__PURE__ */ new Matrix4(), _ray$4 = /* @__PURE__ */ new Ray(), _sphere$7 = /* @__PURE__ */ new Sphere$1(), _position$2$1 = /* @__PURE__ */ new Vector3();
12275
12275
  class Points extends Object3D {
12276
12276
  /**
12277
12277
  * Constructs a new point cloud.
@@ -12294,18 +12294,18 @@ class Points extends Object3D {
12294
12294
  raycast(e, r) {
12295
12295
  const o = this.geometry, V = this.matrixWorld, le = e.params.Points.threshold, fe = o.drawRange;
12296
12296
  if (o.boundingSphere === null && o.computeBoundingSphere(), _sphere$7.copy(o.boundingSphere), _sphere$7.applyMatrix4(V), _sphere$7.radius += le, e.ray.intersectsSphere(_sphere$7) === !1) return;
12297
- _inverseMatrix.copy(V).invert(), _ray$4.copy(e.ray).applyMatrix4(_inverseMatrix);
12297
+ _inverseMatrix$4.copy(V).invert(), _ray$4.copy(e.ray).applyMatrix4(_inverseMatrix$4);
12298
12298
  const Le = le / ((this.scale.x + this.scale.y + this.scale.z) / 3), Ce = Le * Le, Re = o.index, ze = o.attributes.position;
12299
12299
  if (Re !== null) {
12300
12300
  const Fe = Math.max(0, fe.start), ke = Math.min(Re.count, fe.start + fe.count);
12301
12301
  for (let Gt = Fe, Vt = ke; Gt < Vt; Gt++) {
12302
12302
  const Xt = Re.getX(Gt);
12303
- _position$2.fromBufferAttribute(ze, Xt), testPoint(_position$2, Xt, Ce, V, e, r, this);
12303
+ _position$2$1.fromBufferAttribute(ze, Xt), testPoint$1(_position$2$1, Xt, Ce, V, e, r, this);
12304
12304
  }
12305
12305
  } else {
12306
12306
  const Fe = Math.max(0, fe.start), ke = Math.min(ze.count, fe.start + fe.count);
12307
12307
  for (let Gt = Fe, Vt = ke; Gt < Vt; Gt++)
12308
- _position$2.fromBufferAttribute(ze, Gt), testPoint(_position$2, Gt, Ce, V, e, r, this);
12308
+ _position$2$1.fromBufferAttribute(ze, Gt), testPoint$1(_position$2$1, Gt, Ce, V, e, r, this);
12309
12309
  }
12310
12310
  }
12311
12311
  /**
@@ -12326,7 +12326,7 @@ class Points extends Object3D {
12326
12326
  }
12327
12327
  }
12328
12328
  }
12329
- function testPoint(v, e, r, o, V, le, fe) {
12329
+ function testPoint$1(v, e, r, o, V, le, fe) {
12330
12330
  const Le = _ray$4.distanceSqToPoint(v);
12331
12331
  if (Le < r) {
12332
12332
  const Ce = new Vector3();
@@ -40641,21 +40641,21 @@ class RaySet {
40641
40641
  }
40642
40642
  }
40643
40643
  }
40644
- const _v0 = new Vector3(), _v1$1 = new Vector3(), _ray$2 = new Ray();
40644
+ const _v0 = new Vector3(), _v1$1 = new Vector3(), _ray$3 = new Ray();
40645
40645
  function computeDisjointEdges(v, e, r) {
40646
40646
  const o = v.attributes, V = v.index, le = o.position, fe = /* @__PURE__ */ new Map(), Le = /* @__PURE__ */ new Map(), Ce = Array.from(e), Re = new RaySet();
40647
40647
  for (let Pe = 0, ze = Ce.length; Pe < ze; Pe++) {
40648
40648
  const Fe = Ce[Pe], ke = toTriIndex(Fe), Gt = toEdgeIndex(Fe);
40649
40649
  let Vt = 3 * ke + Gt, Xt = 3 * ke + (Gt + 1) % 3;
40650
- V && (Vt = V.getX(Vt), Xt = V.getX(Xt)), _v0.fromBufferAttribute(le, Vt), _v1$1.fromBufferAttribute(le, Xt), toNormalizedRay(_v0, _v1$1, _ray$2);
40651
- let xt, Zt = Re.findClosestRay(_ray$2);
40652
- Zt === null && (Zt = _ray$2.clone(), Re.addRay(Zt)), Le.has(Zt) || Le.set(Zt, {
40650
+ V && (Vt = V.getX(Vt), Xt = V.getX(Xt)), _v0.fromBufferAttribute(le, Vt), _v1$1.fromBufferAttribute(le, Xt), toNormalizedRay(_v0, _v1$1, _ray$3);
40651
+ let xt, Zt = Re.findClosestRay(_ray$3);
40652
+ Zt === null && (Zt = _ray$3.clone(), Re.addRay(Zt)), Le.has(Zt) || Le.set(Zt, {
40653
40653
  forward: [],
40654
40654
  reverse: [],
40655
40655
  ray: Zt
40656
40656
  }), xt = Le.get(Zt);
40657
40657
  let wt = getProjectedDistance(Zt, _v0), Wt = getProjectedDistance(Zt, _v1$1);
40658
- wt > Wt && ([wt, Wt] = [Wt, wt]), _ray$2.direction.dot(Zt.direction) < 0 ? xt.reverse.push({ start: wt, end: Wt, index: Fe }) : xt.forward.push({ start: wt, end: Wt, index: Fe });
40658
+ wt > Wt && ([wt, Wt] = [Wt, wt]), _ray$3.direction.dot(Zt.direction) < 0 ? xt.reverse.push({ start: wt, end: Wt, index: Fe }) : xt.forward.push({ start: wt, end: Wt, index: Fe });
40659
40659
  }
40660
40660
  return Le.forEach(({ forward: Pe, reverse: ze }, Fe) => {
40661
40661
  matchEdges(Pe, ze, fe, r), Pe.length === 0 && ze.length === 0 && Le.delete(Fe);
@@ -41033,27 +41033,27 @@ class IntersectionMap {
41033
41033
  o[e] || (o[e] = [], V.push(e)), o[e].push(r);
41034
41034
  }
41035
41035
  }
41036
- const ADDITION = 0, SUBTRACTION = 1, REVERSE_SUBTRACTION = 2, INTERSECTION = 3, DIFFERENCE = 4, HOLLOW_SUBTRACTION = 5, HOLLOW_INTERSECTION = 6, _ray$1 = new Ray(), _matrix$1 = new Matrix4(), _tri$1 = new Triangle(), _vec3 = new Vector3(), _vec4a = new Vector4(), _vec4b = new Vector4(), _vec4c = new Vector4(), _vec4_0 = new Vector4(), _vec4_1 = new Vector4(), _vec4_2 = new Vector4(), _edge = new Line3(), _normal = new Vector3(), JITTER_EPSILON = 1e-8, OFFSET_EPSILON = 1e-15, BACK_SIDE = -1, FRONT_SIDE = 1, COPLANAR_OPPOSITE = -2, COPLANAR_ALIGNED = 2, INVERT_TRI = 0, ADD_TRI = 1, SKIP_TRI = 2, FLOATING_COPLANAR_EPSILON = 1e-14;
41036
+ const ADDITION = 0, SUBTRACTION = 1, REVERSE_SUBTRACTION = 2, INTERSECTION = 3, DIFFERENCE = 4, HOLLOW_SUBTRACTION = 5, HOLLOW_INTERSECTION = 6, _ray$2 = new Ray(), _matrix$1 = new Matrix4(), _tri$1 = new Triangle(), _vec3 = new Vector3(), _vec4a = new Vector4(), _vec4b = new Vector4(), _vec4c = new Vector4(), _vec4_0 = new Vector4(), _vec4_1 = new Vector4(), _vec4_2 = new Vector4(), _edge = new Line3(), _normal = new Vector3(), JITTER_EPSILON = 1e-8, OFFSET_EPSILON = 1e-15, BACK_SIDE = -1, FRONT_SIDE = 1, COPLANAR_OPPOSITE = -2, COPLANAR_ALIGNED = 2, INVERT_TRI = 0, ADD_TRI = 1, SKIP_TRI = 2, FLOATING_COPLANAR_EPSILON = 1e-14;
41037
41037
  let _debugContext = null;
41038
41038
  function setDebugContext(v) {
41039
41039
  _debugContext = v;
41040
41040
  }
41041
41041
  function getHitSide(v, e) {
41042
- v.getMidpoint(_ray$1.origin), v.getNormal(_ray$1.direction);
41043
- const r = e.raycastFirst(_ray$1, DoubleSide);
41044
- return !!(r && _ray$1.direction.dot(r.face.normal) > 0) ? BACK_SIDE : FRONT_SIDE;
41042
+ v.getMidpoint(_ray$2.origin), v.getNormal(_ray$2.direction);
41043
+ const r = e.raycastFirst(_ray$2, DoubleSide);
41044
+ return !!(r && _ray$2.direction.dot(r.face.normal) > 0) ? BACK_SIDE : FRONT_SIDE;
41045
41045
  }
41046
41046
  function getHitSideWithCoplanarCheck(v, e) {
41047
41047
  function r() {
41048
41048
  return Math.random() - 0.5;
41049
41049
  }
41050
- v.getNormal(_normal), _ray$1.direction.copy(_normal), v.getMidpoint(_ray$1.origin);
41050
+ v.getNormal(_normal), _ray$2.direction.copy(_normal), v.getMidpoint(_ray$2.origin);
41051
41051
  const o = 3;
41052
41052
  let V = 0, le = 1 / 0;
41053
41053
  for (let fe = 0; fe < o; fe++) {
41054
- _ray$1.direction.x += r() * JITTER_EPSILON, _ray$1.direction.y += r() * JITTER_EPSILON, _ray$1.direction.z += r() * JITTER_EPSILON, _ray$1.direction.multiplyScalar(-1);
41055
- const Le = e.raycastFirst(_ray$1, DoubleSide);
41056
- if (!!(Le && _ray$1.direction.dot(Le.face.normal) > 0) && V++, Le !== null && (le = Math.min(le, Le.distance)), le <= OFFSET_EPSILON)
41054
+ _ray$2.direction.x += r() * JITTER_EPSILON, _ray$2.direction.y += r() * JITTER_EPSILON, _ray$2.direction.z += r() * JITTER_EPSILON, _ray$2.direction.multiplyScalar(-1);
41055
+ const Le = e.raycastFirst(_ray$2, DoubleSide);
41056
+ if (!!(Le && _ray$2.direction.dot(Le.face.normal) > 0) && V++, Le !== null && (le = Math.min(le, Le.distance)), le <= OFFSET_EPSILON)
41057
41057
  return Le.face.normal.dot(_normal) > 0 ? COPLANAR_ALIGNED : COPLANAR_OPPOSITE;
41058
41058
  if (V / o > 0.5 || (fe - V + 1) / o > 0.5)
41059
41059
  break;
@@ -41486,8 +41486,8 @@ class RectAreaLightUniformsLib {
41486
41486
  UniformsLib.LTC_FLOAT_1 = e, UniformsLib.LTC_FLOAT_2 = r, UniformsLib.LTC_HALF_1 = o, UniformsLib.LTC_HALF_2 = V;
41487
41487
  }
41488
41488
  }
41489
- const _viewport = new Vector4(), _start = new Vector3(), _end = new Vector3(), _start4 = new Vector4(), _end4 = new Vector4(), _ssOrigin = new Vector4(), _ssOrigin3 = new Vector3(), _mvMatrix = new Matrix4(), _line = new Line3(), _closestPoint = new Vector3(), _box = new Box3(), _sphere = new Sphere$1(), _clipToWorldVector = new Vector4();
41490
- let _ray, _lineWidth;
41489
+ const _viewport = new Vector4(), _start = new Vector3(), _end = new Vector3(), _start4 = new Vector4(), _end4 = new Vector4(), _ssOrigin = new Vector4(), _ssOrigin3 = new Vector3(), _mvMatrix = new Matrix4(), _line = new Line3(), _closestPoint = new Vector3(), _box = new Box3(), _sphere$1 = new Sphere$1(), _clipToWorldVector = new Vector4();
41490
+ let _ray$1, _lineWidth;
41491
41491
  function getWorldSpaceHalfWidth(v, e, r) {
41492
41492
  return _clipToWorldVector.set(0, 0, -e, 1).applyMatrix4(v.projectionMatrix), _clipToWorldVector.multiplyScalar(1 / _clipToWorldVector.w), _clipToWorldVector.x = _lineWidth / r.width, _clipToWorldVector.y = _lineWidth / r.height, _clipToWorldVector.applyMatrix4(v.projectionMatrixInverse), _clipToWorldVector.multiplyScalar(1 / _clipToWorldVector.w), Math.abs(Math.max(_clipToWorldVector.x, _clipToWorldVector.y));
41493
41493
  }
@@ -41496,10 +41496,10 @@ function raycastWorldUnits(v, e) {
41496
41496
  for (let Le = 0, Ce = fe; Le < Ce; Le++) {
41497
41497
  _line.start.fromBufferAttribute(V, Le), _line.end.fromBufferAttribute(le, Le), _line.applyMatrix4(r);
41498
41498
  const Re = new Vector3(), Pe = new Vector3();
41499
- _ray.distanceSqToSegment(_line.start, _line.end, Pe, Re), Pe.distanceTo(Re) < _lineWidth * 0.5 && e.push({
41499
+ _ray$1.distanceSqToSegment(_line.start, _line.end, Pe, Re), Pe.distanceTo(Re) < _lineWidth * 0.5 && e.push({
41500
41500
  point: Pe,
41501
41501
  pointOnLine: Re,
41502
- distance: _ray.origin.distanceTo(Pe),
41502
+ distance: _ray$1.origin.distanceTo(Pe),
41503
41503
  object: v,
41504
41504
  face: null,
41505
41505
  faceIndex: Le,
@@ -41510,7 +41510,7 @@ function raycastWorldUnits(v, e) {
41510
41510
  }
41511
41511
  function raycastScreenSpace(v, e, r) {
41512
41512
  const o = e.projectionMatrix, le = v.material.resolution, fe = v.matrixWorld, Le = v.geometry, Ce = Le.attributes.instanceStart, Re = Le.attributes.instanceEnd, Pe = Math.min(Le.instanceCount, Ce.count), ze = -e.near;
41513
- _ray.at(1, _ssOrigin), _ssOrigin.w = 1, _ssOrigin.applyMatrix4(e.matrixWorldInverse), _ssOrigin.applyMatrix4(o), _ssOrigin.multiplyScalar(1 / _ssOrigin.w), _ssOrigin.x *= le.x / 2, _ssOrigin.y *= le.y / 2, _ssOrigin.z = 0, _ssOrigin3.copy(_ssOrigin), _mvMatrix.multiplyMatrices(e.matrixWorldInverse, fe);
41513
+ _ray$1.at(1, _ssOrigin), _ssOrigin.w = 1, _ssOrigin.applyMatrix4(e.matrixWorldInverse), _ssOrigin.applyMatrix4(o), _ssOrigin.multiplyScalar(1 / _ssOrigin.w), _ssOrigin.x *= le.x / 2, _ssOrigin.y *= le.y / 2, _ssOrigin.z = 0, _ssOrigin3.copy(_ssOrigin), _mvMatrix.multiplyMatrices(e.matrixWorldInverse, fe);
41514
41514
  for (let Fe = 0, ke = Pe; Fe < ke; Fe++) {
41515
41515
  if (_start4.fromBufferAttribute(Ce, Fe), _end4.fromBufferAttribute(Re, Fe), _start4.w = 1, _end4.w = 1, _start4.applyMatrix4(_mvMatrix), _end4.applyMatrix4(_mvMatrix), _start4.z > ze && _end4.z > ze)
41516
41516
  continue;
@@ -41528,10 +41528,10 @@ function raycastScreenSpace(v, e, r) {
41528
41528
  if (xt && Zt) {
41529
41529
  _line.start.fromBufferAttribute(Ce, Fe), _line.end.fromBufferAttribute(Re, Fe), _line.start.applyMatrix4(fe), _line.end.applyMatrix4(fe);
41530
41530
  const wt = new Vector3(), Wt = new Vector3();
41531
- _ray.distanceSqToSegment(_line.start, _line.end, Wt, wt), r.push({
41531
+ _ray$1.distanceSqToSegment(_line.start, _line.end, Wt, wt), r.push({
41532
41532
  point: Wt,
41533
41533
  pointOnLine: wt,
41534
- distance: _ray.origin.distanceTo(Wt),
41534
+ distance: _ray$1.origin.distanceTo(Wt),
41535
41535
  object: v,
41536
41536
  face: null,
41537
41537
  faceIndex: Fe,
@@ -41575,27 +41575,27 @@ class LineSegments2 extends Mesh {
41575
41575
  const o = this.material.worldUnits, V = e.camera;
41576
41576
  V === null && !o && console.error('LineSegments2: "Raycaster.camera" needs to be set in order to raycast against LineSegments2 while worldUnits is set to false.');
41577
41577
  const le = e.params.Line2 !== void 0 && e.params.Line2.threshold || 0;
41578
- _ray = e.ray;
41578
+ _ray$1 = e.ray;
41579
41579
  const fe = this.matrixWorld, Le = this.geometry, Ce = this.material;
41580
- _lineWidth = Ce.linewidth + le, Le.boundingSphere === null && Le.computeBoundingSphere(), _sphere.copy(Le.boundingSphere).applyMatrix4(fe);
41580
+ _lineWidth = Ce.linewidth + le, Le.boundingSphere === null && Le.computeBoundingSphere(), _sphere$1.copy(Le.boundingSphere).applyMatrix4(fe);
41581
41581
  let Re;
41582
41582
  if (o)
41583
41583
  Re = _lineWidth * 0.5;
41584
41584
  else {
41585
- const ze = Math.max(V.near, _sphere.distanceToPoint(_ray.origin));
41585
+ const ze = Math.max(V.near, _sphere$1.distanceToPoint(_ray$1.origin));
41586
41586
  Re = getWorldSpaceHalfWidth(V, ze, Ce.resolution);
41587
41587
  }
41588
- if (_sphere.radius += Re, _ray.intersectsSphere(_sphere) === !1)
41588
+ if (_sphere$1.radius += Re, _ray$1.intersectsSphere(_sphere$1) === !1)
41589
41589
  return;
41590
41590
  Le.boundingBox === null && Le.computeBoundingBox(), _box.copy(Le.boundingBox).applyMatrix4(fe);
41591
41591
  let Pe;
41592
41592
  if (o)
41593
41593
  Pe = _lineWidth * 0.5;
41594
41594
  else {
41595
- const ze = Math.max(V.near, _box.distanceToPoint(_ray.origin));
41595
+ const ze = Math.max(V.near, _box.distanceToPoint(_ray$1.origin));
41596
41596
  Pe = getWorldSpaceHalfWidth(V, ze, Ce.resolution);
41597
41597
  }
41598
- _box.expandByScalar(Pe), _ray.intersectsBox(_box) !== !1 && (o ? raycastWorldUnits(this, r) : raycastScreenSpace(this, V, r));
41598
+ _box.expandByScalar(Pe), _ray$1.intersectsBox(_box) !== !1 && (o ? raycastWorldUnits(this, r) : raycastScreenSpace(this, V, r));
41599
41599
  }
41600
41600
  onBeforeRender(e) {
41601
41601
  const r = this.material.uniforms;
@@ -141299,29 +141299,29 @@ class Area extends Z$1 {
141299
141299
  create() {
141300
141300
  return U0(this, null, function* () {
141301
141301
  this.createGroup();
141302
- const { json: r, projection: o, type: V, cacheKey: le, material: fe, oArr: Le } = this.options, Ce = this.pencil.getPlugin("worker"), Re = this.pencil.lead;
141302
+ const { jsonUrl: r, projection: o, type: V, cacheKey: le, material: fe, oArr: Le } = this.options, Ce = this.pencil.getPlugin("worker"), Re = this.pencil.lead;
141303
141303
  let Pe = le ? yield Ce.getCachedGeometry({
141304
141304
  cacheKey: le
141305
141305
  }) : [];
141306
141306
  if (!Pe.length) {
141307
- const ze = {};
141308
- (r.features || r).forEach((Fe) => {
141309
- const ke = Fe.properties.o || 0, Gt = "all";
141310
- ze[Gt] || (ze[Gt] = []);
141311
- let Vt = [];
141312
- Fe.geometry.type === "Polygon" ? Vt = Fe.geometry.coordinates : Fe.geometry.type === "MultiPolygon" && (Vt = Fe.geometry.coordinates.flat()), Vt.forEach((Xt) => {
141313
- const xt = Le != null && Le.length ? Le.findIndex((Zt) => Zt === +ke) * 1e-3 : 0;
141314
- ze[Gt].push({
141315
- c: Xt,
141316
- m: [0, xt]
141307
+ const ze = {}, Fe = yield this.pencil.loader.load(r);
141308
+ (Fe.features || Fe).forEach((ke) => {
141309
+ const Gt = ke.properties.o || 0, Vt = "all";
141310
+ ze[Vt] || (ze[Vt] = []);
141311
+ let Xt = [];
141312
+ ke.geometry.type === "Polygon" ? Xt = ke.geometry.coordinates : ke.geometry.type === "MultiPolygon" && (Xt = ke.geometry.coordinates.flat()), Xt.forEach((xt) => {
141313
+ const Zt = Le != null && Le.length ? Le.findIndex((wt) => wt === +Gt) * 1e-3 : 0;
141314
+ ze[Vt].push({
141315
+ c: xt,
141316
+ m: [0, Zt]
141317
141317
  });
141318
141318
  });
141319
141319
  }), Pe = yield Promise.all(
141320
- Object.keys(ze).map((Fe) => {
141321
- const ke = ze[Fe].map((Vt) => Vt.c), Gt = ze[Fe].map((Vt) => Vt.m);
141320
+ Object.keys(ze).map((ke) => {
141321
+ const Gt = ze[ke].map((Xt) => Xt.c), Vt = ze[ke].map((Xt) => Xt.m);
141322
141322
  return Ce.geoGeometry("extrudePolygon", {
141323
- coordinatesArr: ke,
141324
- metaArray: Gt,
141323
+ coordinatesArr: Gt,
141324
+ metaArray: Vt,
141325
141325
  cacheKey: le,
141326
141326
  mesaage: {
141327
141327
  projection: o,
@@ -142171,17 +142171,6 @@ class City$1 extends Base {
142171
142171
  "/image/city/max.webp"
142172
142172
  ]);
142173
142173
  }
142174
- loaderAddJson(r) {
142175
- this.loader.add(
142176
- [
142177
- this.options.showRiver && `/cityGzip/River${r}.json.gzip`,
142178
- this.options.showGrassland && `/cityGzip/Grassland${r}.json.gzip`
142179
- ].filter(Boolean),
142180
- {
142181
- // cacheVersion: '1',
142182
- }
142183
- );
142184
- }
142185
142174
  initMaterial() {
142186
142175
  return U0(this, null, function* () {
142187
142176
  if (this.mList.get("city-plane-mat")) {
@@ -142304,15 +142293,15 @@ class City$1 extends Base {
142304
142293
  }
142305
142294
  init() {
142306
142295
  return U0(this, null, function* () {
142307
- const { jsonName: r, adcode: o } = this.options;
142308
- yield this.initPencil(), this.loaderAdd(), this.loaderAddJson(r), console.time(`vis-core:time.${this.visName}${o}-loader`), yield this.loader.loadAll(), console.timeEnd(`vis-core:time.${this.visName}${o}-loader`), this.settings.mouseLeft = Xi.SCREEN_PAN, yield this.settings.mouseLeft, this.pencil.camera.userData.up = "0,0,1", this.adcode = this.options.adcode, this.options.center && (this.pcenter = this.options.center), this.projection = f({
142296
+ const { adcode: r } = this.options;
142297
+ yield this.initPencil(), this.loaderAdd(), console.time(`vis-core:time.${this.visName}${r}-loader`), yield this.loader.loadAll(), console.timeEnd(`vis-core:time.${this.visName}${r}-loader`), this.settings.mouseLeft = Xi.SCREEN_PAN, yield this.settings.mouseLeft, this.pencil.camera.userData.up = "0,0,1", this.adcode = this.options.adcode, this.options.center && (this.pcenter = this.options.center), this.projection = f({
142309
142298
  center: this.pcenter,
142310
142299
  scale: this.pscale
142311
142300
  }), this.group = yield this.lead.draw("Group", {
142312
- key: `city${o}`
142301
+ key: `city${r}`
142313
142302
  });
142314
- const V = findAdcodeInfo(o);
142315
- this.group.object3d.name = `城市-${V ? V.name : o}`, this.group.scale.multiplyScalar(this.multiplyScalar), yield this.initMaterial(), yield this.initVis(), yield Promise.all(this.lead.objectsPromise);
142303
+ const o = findAdcodeInfo(r);
142304
+ this.group.object3d.name = `城市-${o ? o.name : r}`, this.group.scale.multiplyScalar(this.multiplyScalar), yield this.initMaterial(), yield this.initVis(), yield Promise.all(this.lead.objectsPromise);
142316
142305
  });
142317
142306
  }
142318
142307
  getInvert(r) {
@@ -142329,44 +142318,46 @@ class City$1 extends Base {
142329
142318
  }
142330
142319
  initVis() {
142331
142320
  return U0(this, null, function* () {
142332
- const { fitTo: r, jsonName: o } = this.options;
142333
- this.adcode;
142334
- const V = this.loader, le = this.options.showRiver && V.getAsset(`/cityGzip/River${o}.json.gzip`), fe = this.options.showGrassland && V.getAsset(`/cityGzip/Grassland${o}.json.gzip`), Le = {};
142335
- [
142336
- ...(le == null ? void 0 : le.features) || [],
142337
- ...(fe == null ? void 0 : fe.features) || []
142338
- ].forEach((Pe) => {
142339
- Pe.properties.o && (Le[Pe.properties.o] = !0);
142340
- });
142341
- const Ce = Object.keys(Le).map((Pe) => +Pe).sort((Pe, ze) => Pe - ze), Re = -f({
142321
+ const { jsonName: r } = this.options, o = this.adcode, V = this.loader;
142322
+ let le = [];
142323
+ if (le = JSON.parse(localStorage.getItem("city-oArr" + o) || "[]"), !le.length) {
142324
+ const Le = this.options.showRiver && (yield V.load(`/cityGzip/River${r}.json.gzip`)), Ce = this.options.showGrassland && (yield V.load(`/cityGzip/Grassland${r}.json.gzip`)), Re = {};
142325
+ [
142326
+ ...(Le == null ? void 0 : Le.features) || [],
142327
+ ...(Ce == null ? void 0 : Ce.features) || []
142328
+ ].forEach((Pe) => {
142329
+ Pe.properties.o && (Re[Pe.properties.o] = !0);
142330
+ }), le = Object.keys(Re).map((Pe) => +Pe).sort((Pe, ze) => Pe - ze), localStorage.setItem("city-oArr" + o, JSON.stringify(le));
142331
+ }
142332
+ const fe = -f({
142342
142333
  center: this.pcenter,
142343
142334
  scale: this.pscale
142344
142335
  })([this.pcenter[0], 899e-8 + this.pcenter[1]])[1];
142345
142336
  yield Promise.all(
142346
142337
  [
142347
142338
  this.options.showBuilding && this.drawBuilding({
142348
- jsonUrl: `/cityGzip/Building${o}.json.gzip`,
142349
- meters: Re,
142339
+ jsonUrl: `/cityGzip/Building${r}.json.gzip`,
142340
+ meters: fe,
142350
142341
  grey: this.options.grey,
142351
142342
  sideGradient: this.options.buildingSideGradient,
142352
142343
  hasSide: this.options.buildingHasSide
142353
142344
  }),
142354
142345
  this.options.showRoad && this.drawRoad({
142355
- jsonUrl: `/cityGzip/Road${o}.json.gzip`,
142356
- meters: Re,
142357
- z: Ce.length,
142346
+ jsonUrl: `/cityGzip/Road${r}.json.gzip`,
142347
+ meters: fe,
142348
+ z: le.length,
142358
142349
  grey: this.options.grey
142359
142350
  }),
142360
- le && this.drawArea({
142361
- json: le,
142351
+ this.options.showRiver && this.drawArea({
142352
+ jsonUrl: `/cityGzip/River${r}.json.gzip`,
142362
142353
  type: "river",
142363
- oArr: Ce,
142354
+ oArr: le,
142364
142355
  grey: this.options.grey
142365
142356
  }),
142366
- fe && this.drawArea({
142367
- json: fe,
142357
+ this.options.showGrassland && this.drawArea({
142358
+ jsonUrl: `/cityGzip/Grassland${r}.json.gzip`,
142368
142359
  type: "grassland",
142369
- oArr: Ce,
142360
+ oArr: le,
142370
142361
  grey: this.options.grey
142371
142362
  })
142372
142363
  ].filter(Boolean)
@@ -142419,7 +142410,7 @@ class City$1 extends Base {
142419
142410
  }
142420
142411
  drawArea() {
142421
142412
  return U0(this, arguments, function* (r = {}) {
142422
- if (!r.json) {
142413
+ if (!r.jsonUrl) {
142423
142414
  console.warn(" json:drawGeography");
142424
142415
  return;
142425
142416
  }
@@ -142432,7 +142423,7 @@ class City$1 extends Base {
142432
142423
  center: this.pcenter,
142433
142424
  scale: this.pscale
142434
142425
  },
142435
- json: r.json,
142426
+ jsonUrl: r.jsonUrl,
142436
142427
  material: this.mList.getMultiple("geography" + V)[r.type],
142437
142428
  type: r.type,
142438
142429
  cacheKey: le,
@@ -145220,6 +145211,7 @@ class MapManager {
145220
145211
  C0(this, "controlsContainer");
145221
145212
  C0(this, "assetsPrefix");
145222
145213
  C0(this, "fixConfig");
145214
+ C0(this, "raycasterPointsThreshold");
145223
145215
  // 缩放控制常量
145224
145216
  C0(this, "MAX_ZOOM_FACTOR", 0.3);
145225
145217
  // 最大缩放距离因子
@@ -145237,8 +145229,7 @@ class MapManager {
145237
145229
  C0(this, "eventHandlers", {});
145238
145230
  // 定时器管理
145239
145231
  C0(this, "areaCloseTimer", null);
145240
- C0(this, "unitCloseTimer", null);
145241
- this.container = e.container, this.controlsContainer = e.controlsContainer || e.container, this.assetsPrefix = e.assetsPrefix, this.fixConfig = e.fixConfig;
145232
+ this.container = e.container, this.controlsContainer = e.controlsContainer || e.container, this.assetsPrefix = e.assetsPrefix, this.fixConfig = e.fixConfig, this.raycasterPointsThreshold = e.raycasterPointsThreshold || 5e-3;
145242
145233
  }
145243
145234
  /**
145244
145235
  * 设置事件处理器
@@ -145246,6 +145237,13 @@ class MapManager {
145246
145237
  setEventHandlers(e) {
145247
145238
  this.eventHandlers = gi(gi({}, this.eventHandlers), e);
145248
145239
  }
145240
+ /**
145241
+ * 触发事件
145242
+ */
145243
+ emit(e, ...r) {
145244
+ const o = this.eventHandlers[e];
145245
+ o && typeof o == "function" && o(...r);
145246
+ }
145249
145247
  /**
145250
145248
  * 获取当前地图实例
145251
145249
  */
@@ -145272,13 +145270,13 @@ class MapManager {
145272
145270
  */
145273
145271
  createMapInstance(e, r = !1) {
145274
145272
  return U0(this, null, function* () {
145275
- var Pe, ze, Fe, ke, Gt, Vt;
145273
+ var Pe, ze;
145276
145274
  const o = Object.values(this.mapInstances)[0], V = (Pe = Map$1.getAdcodeShowLevel(e)) != null ? Pe : "country", le = Map$1.findAdcodeInfo(e), fe = o == null ? void 0 : o.pencil, Le = this.mapInstances[V];
145277
145275
  if (Le)
145278
145276
  if (Le.pencil.controls.maxDistance = 1 / 0, Le.pencil.controls.minDistance = 0, Le.options.adcode === e && !r && !Le.options.fixedAdcode) {
145279
145277
  Le.setSceneActive(), this.currentMap = Le, Le.pencil.controls.maxDistance = this.mapDistances[V] / this.MAX_ZOOM_FACTOR, Le.pencil.controls.minDistance = this.mapDistances[V] / this.MIN_ZOOM_FACTOR;
145280
- const Xt = Le.pencil.controls.distance, xt = Math.round(this.mapDistances[V] / Xt * 10) / 10;
145281
- return this.currentZoom !== xt && (this.currentZoom = xt, (Fe = (ze = this.eventHandlers).onZoomChange) == null || Fe.call(ze, xt)), Le;
145278
+ const Fe = Le.pencil.controls.distance, ke = Math.round(this.mapDistances[V] / Fe * 10) / 10;
145279
+ return this.currentZoom !== ke && (this.currentZoom = ke, this.emit("zoomChange", ke)), Le;
145282
145280
  } else
145283
145281
  Le.options.pencil = fe, Le.dispose(), delete this.mapInstances[V];
145284
145282
  const Ce = new Map$1({
@@ -145288,25 +145286,24 @@ class MapManager {
145288
145286
  pencil: fe
145289
145287
  });
145290
145288
  let Re = 0;
145291
- return yield Ce.fromJSON((ke = this.mapConfigs[V]) != null ? ke : `/${V}.gz`, {
145292
- preprocessor: (Xt) => U0(this, null, function* () {
145293
- if (Re = Xt.h.u[0].visOptions.adcode, V === "province" || V === "city" || V === "district") {
145294
- const xt = yield getMapConfig(
145289
+ return yield Ce.fromJSON((ze = this.mapConfigs[V]) != null ? ze : `/${V}.gz`, {
145290
+ preprocessor: (Fe) => U0(this, null, function* () {
145291
+ if (Re = Fe.h.u[0].visOptions.adcode, V === "province" || V === "city" || V === "district") {
145292
+ const ke = yield getMapConfig(
145295
145293
  e,
145296
145294
  this.assetsPrefix,
145297
- Xt.h.u[0].visOptions,
145298
- Xt.h.i
145295
+ Fe.h.u[0].visOptions,
145296
+ Fe.h.i
145299
145297
  );
145300
- Xt.h.u[0].visOptions = xt, le != null && le.c.length && (Xt.h.u[0].visOptions.showBuilding = !1);
145298
+ Fe.h.u[0].visOptions = ke, le != null && le.c.length && (Fe.h.u[0].visOptions.showBuilding = !1);
145301
145299
  }
145302
- return Xt;
145300
+ return Fe;
145303
145301
  }),
145304
145302
  useCache: !0
145305
- }), Ce.pencil.camera.near = 0.01, Ce.pencil.camera.updateProjectionMatrix(), Ce.pencil.controls.addEventListener("update", () => {
145306
- var Zt, wt;
145307
- const Xt = Ce.pencil.controls.distance, xt = Math.round(this.mapDistances[V] / Xt * 10) / 10;
145308
- this.currentZoom !== xt && (this.currentZoom = xt, (wt = (Zt = this.eventHandlers).onZoomChange) == null || wt.call(Zt, xt));
145309
- }), V !== "country" && (Ce.options.mapPadding = [220, 300, 70, 0], Ce.options.polarAngle = -Math.PI, yield Ce.fitTo(Ce.map, { enableTransition: !1 }), yield Ce.fitTo(Ce.map, { enableTransition: !1 })), this.applyFixConfig(Ce, V, Re, e), le != null && le.c.length && !r && this.bindAreaEvents(Ce), this.mapInstances[V] = Ce, Ce.setSceneActive(), this.currentMap = Ce, this.currentZoom = 1, (Vt = (Gt = this.eventHandlers).onZoomChange) == null || Vt.call(Gt, 1), this.mapDistances[V] = Ce.pencil.controls.distance, Ce.pencil.controls.maxDistance = Ce.pencil.controls.distance / this.MAX_ZOOM_FACTOR, Ce.pencil.controls.minDistance = Ce.pencil.controls.distance / this.MIN_ZOOM_FACTOR, Ce.options.fixedAdcode = r, Ce;
145303
+ }), Ce.pencil.camera.near = 0.01, Ce.pencil.camera.updateProjectionMatrix(), Ce.pencil.raycaster.params.Points.threshold = this.raycasterPointsThreshold, Ce.pencil.controls.addEventListener("update", () => {
145304
+ const Fe = Ce.pencil.controls.distance, ke = Math.round(this.mapDistances[V] / Fe * 10) / 10;
145305
+ this.currentZoom !== ke && (this.currentZoom = ke, this.emit("zoomChange", ke));
145306
+ }), V !== "country" && (Ce.options.mapPadding = [220, 300, 70, 0], Ce.options.polarAngle = -Math.PI, yield Ce.fitTo(Ce.map, { enableTransition: !1 }), yield Ce.fitTo(Ce.map, { enableTransition: !1 })), this.applyFixConfig(Ce, V, Re, e), le != null && le.c.length && !r && this.bindAreaEvents(Ce), this.mapInstances[V] = Ce, Ce.setSceneActive(), this.currentMap = Ce, this.currentZoom = 1, this.emit("zoomChange", 1), this.mapDistances[V] = Ce.pencil.controls.distance, Ce.pencil.controls.maxDistance = Ce.pencil.controls.distance / this.MAX_ZOOM_FACTOR, Ce.pencil.controls.minDistance = Ce.pencil.controls.distance / this.MIN_ZOOM_FACTOR, Ce.options.fixedAdcode = r, Ce;
145310
145307
  });
145311
145308
  }
145312
145309
  /**
@@ -145333,29 +145330,29 @@ class MapManager {
145333
145330
  * 绑定区域交互事件
145334
145331
  */
145335
145332
  bindAreaEvents(e) {
145336
- e.mapArea.forEach((r) => {
145337
- r.onPointerEnter(() => {
145338
- var fe, Le;
145339
- this.areaCloseTimer && (clearTimeout(this.areaCloseTimer), this.areaCloseTimer = null), r.useMListByName("顶面高亮", 0);
145340
- const o = r.userData.centroid || r.userData.center;
145341
- if (!o) return;
145342
- const V = e.getLocationPosition([...o]), le = e.getScreenPosition(...V);
145343
- (Le = (fe = this.eventHandlers).onAreaHover) == null || Le.call(fe, r.userData.name, {
145344
- x: le.x,
145345
- y: le.y
145333
+ const r = {};
145334
+ e.mapArea.forEach((o) => {
145335
+ var fe;
145336
+ const V = o.userData.adcode, le = e.cityVis.length === 1 ? e.cityVis[0] : e.cityVis.find((Le) => Le.options.adcode === V);
145337
+ if (le) {
145338
+ const Le = (fe = r[le.options.adcode]) != null ? fe : le.group.getSize().max.z;
145339
+ r[le.options.adcode] = Le;
145340
+ }
145341
+ o.onPointerEnter(() => {
145342
+ this.areaCloseTimer && (clearTimeout(this.areaCloseTimer), this.areaCloseTimer = null), o.useMListByName("顶面高亮", 0), le && (o.position.z = r[le.options.adcode] - e.mapObj.depth);
145343
+ const Le = o.userData.centroid || o.userData.center;
145344
+ if (!Le) return;
145345
+ const Ce = e.getLocationPosition([...Le]), Re = e.getScreenPosition(...Ce);
145346
+ this.emit("areaHover", o.userData.name, {
145347
+ x: Re.x,
145348
+ y: Re.y
145346
145349
  });
145347
- }), r.onPointerLeave(() => {
145348
- r.useMListByName("顶面", 0), this.areaCloseTimer = setTimeout(() => {
145349
- var o, V;
145350
- (V = (o = this.eventHandlers).onAreaLeave) == null || V.call(o);
145350
+ }), o.onPointerLeave(() => {
145351
+ o.useMListByName("顶面", 0), le && (o.position.z = 0), this.areaCloseTimer = setTimeout(() => {
145352
+ this.emit("areaLeave");
145351
145353
  }, 200);
145352
- }), r.onClick(() => {
145353
- var o, V;
145354
- r.useMListByName("顶面", 0), (V = (o = this.eventHandlers).onAreaClick) == null || V.call(
145355
- o,
145356
- r.userData.name,
145357
- r.userData.adcode
145358
- );
145354
+ }), o.onClick(() => {
145355
+ o.useMListByName("顶面", 0), le && (o.position.z = 0), this.emit("areaClick", o.userData.name, o.userData.adcode);
145359
145356
  });
145360
145357
  });
145361
145358
  }
@@ -145404,44 +145401,78 @@ class MapManager {
145404
145401
  e.erase();
145405
145402
  }), this.groups = {};
145406
145403
  }
145407
- /**
145408
- * 触发单位 hover 事件(供外部调用)
145409
- */
145410
- triggerUnitHover(e, r) {
145411
- var o, V;
145412
- this.unitCloseTimer && (clearTimeout(this.unitCloseTimer), this.unitCloseTimer = null), (V = (o = this.eventHandlers).onUnitHover) == null || V.call(o, e, r);
145413
- }
145414
- /**
145415
- * 触发单位 leave 事件(供外部调用)
145416
- */
145417
- triggerUnitLeave() {
145418
- this.unitCloseTimer = setTimeout(() => {
145419
- var e, r;
145420
- (r = (e = this.eventHandlers).onUnitLeave) == null || r.call(e);
145421
- }, 200);
145422
- }
145423
145404
  /**
145424
145405
  * 清除区域关闭定时器(供 PortalModal 调用)
145425
145406
  */
145426
145407
  clearAreaCloseTimer() {
145427
145408
  this.areaCloseTimer && (clearTimeout(this.areaCloseTimer), this.areaCloseTimer = null);
145428
145409
  }
145429
- /**
145430
- * 清除单位关闭定时器(供 PortalModal 调用)
145431
- */
145432
- clearUnitCloseTimer() {
145433
- this.unitCloseTimer && (clearTimeout(this.unitCloseTimer), this.unitCloseTimer = null);
145434
- }
145435
145410
  /**
145436
145411
  * 销毁所有地图实例
145437
145412
  */
145438
145413
  dispose() {
145439
- this.areaCloseTimer && (clearTimeout(this.areaCloseTimer), this.areaCloseTimer = null), this.unitCloseTimer && (clearTimeout(this.unitCloseTimer), this.unitCloseTimer = null), this.clearAllGroups(), Object.values(this.mapInstances).forEach((e) => {
145414
+ this.areaCloseTimer && (clearTimeout(this.areaCloseTimer), this.areaCloseTimer = null), this.clearAllGroups(), Object.values(this.mapInstances).forEach((e) => {
145440
145415
  e.dispose();
145441
145416
  }), this.mapInstances = {}, this.currentMap = null, Editor.clearUrlCache();
145442
145417
  }
145443
145418
  }
145444
145419
  C0(MapManager, "findNameInfo", Map$1.findNameInfo), C0(MapManager, "getAdcodeShowLevel", Map$1.getAdcodeShowLevel), C0(MapManager, "findAdcodeInfo", Map$1.findAdcodeInfo);
145420
+ const _inverseMatrix = /* @__PURE__ */ new Matrix4(), _ray = /* @__PURE__ */ new Ray(), _sphere = /* @__PURE__ */ new Sphere$1(), _position$2 = /* @__PURE__ */ new Vector3();
145421
+ function proposedRaycast(v, e) {
145422
+ const r = this.geometry, o = this.matrixWorld, V = v.params.Points.threshold, le = r.drawRange;
145423
+ r.boundingSphere === null && r.computeBoundingSphere(), _sphere.copy(r.boundingSphere), _sphere.applyMatrix4(o), _sphere.radius += V, _inverseMatrix.copy(o).invert(), _ray.copy(v.ray).applyMatrix4(_inverseMatrix);
145424
+ const fe = V / ((this.scale.x + this.scale.y + this.scale.z) / 3), Le = r.index, Re = r.attributes.position;
145425
+ if (Le !== null) {
145426
+ const Pe = Math.max(0, le.start), ze = Math.min(Le.count, le.start + le.count);
145427
+ for (let Fe = Pe, ke = ze; Fe < ke; Fe++) {
145428
+ const Gt = Le.getX(Fe);
145429
+ _position$2.fromBufferAttribute(Re, Gt), testPoint(
145430
+ _position$2,
145431
+ Gt,
145432
+ fe,
145433
+ o,
145434
+ v,
145435
+ e,
145436
+ this
145437
+ );
145438
+ }
145439
+ } else {
145440
+ const Pe = Math.max(0, le.start), ze = Math.min(
145441
+ Re.count,
145442
+ le.start + le.count
145443
+ );
145444
+ for (let Fe = Pe, ke = ze; Fe < ke; Fe++)
145445
+ _position$2.fromBufferAttribute(Re, Fe), testPoint(
145446
+ _position$2,
145447
+ Fe,
145448
+ fe,
145449
+ o,
145450
+ v,
145451
+ e,
145452
+ this
145453
+ );
145454
+ }
145455
+ }
145456
+ function testPoint(v, e, r, o, V, le, fe) {
145457
+ const Le = new Vector3();
145458
+ _ray.closestPointToPoint(v, Le), Le.applyMatrix4(o);
145459
+ const Ce = V.ray.origin.distanceTo(v), Re = Le.distanceTo(v), Pe = Math.asin(
145460
+ Re / Ce
145461
+ );
145462
+ if (Pe < r) {
145463
+ if (Ce < V.near || Ce > V.far)
145464
+ return;
145465
+ le.push({
145466
+ distance: Ce,
145467
+ distanceToRay: Re,
145468
+ angleToRay: Pe,
145469
+ point: Le,
145470
+ index: e,
145471
+ face: null,
145472
+ object: fe
145473
+ });
145474
+ }
145475
+ }
145445
145476
  const access = {
145446
145477
  set token(v) {
145447
145478
  accessToken.token = v;
@@ -145460,5 +145491,6 @@ export {
145460
145491
  animation as animationUtils,
145461
145492
  getCityConfig,
145462
145493
  getMapConfig,
145494
+ proposedRaycast,
145463
145495
  removeCameraHistory
145464
145496
  };