zywlgis 0.5.41 → 0.5.42

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.
@@ -161058,7 +161058,7 @@ function MoA(...n) {
161058
161058
  return new IoA(...n);
161059
161059
  }
161060
161060
  MoA.localizePositions = IoA.localizePositions;
161061
- const WqA = "0.5.41", _qA = {
161061
+ const WqA = "0.5.42", _qA = {
161062
161062
  version: WqA
161063
161063
  }, hU = {
161064
161064
  POINTERMOVE: "pointermove",
@@ -166354,6 +166354,10 @@ class fWA {
166354
166354
  stopTime_ = void 0;
166355
166355
  velocityOrientationProperty_ = void 0;
166356
166356
  initLoadModel_ = !0;
166357
+ isJudgmentVisual_ = !1;
166358
+ // 是否启用视锥判断(控制是否启用视锥判断)
166359
+ boundingSphere_ = void 0;
166360
+ // 视锥判断的包围球
166357
166361
  /**
166358
166362
  * 构造函数
166359
166363
  * @param {string} containerID - 地图容器ID
@@ -166391,7 +166395,7 @@ class fWA {
166391
166395
  this.clear();
166392
166396
  return;
166393
166397
  }
166394
- this.visible_ = this.data_?.visible ?? !0, this.isClampToGround_ = this.data_?.isClampToGround ?? !1, this.isHighlight_ = this.data_?.isHighlight ?? !1, this.isInterpolation_ = this.data_?.isInterpolation ?? !1;
166398
+ this.isJudgmentVisual_ = this.data_?.isJudgmentVisual ?? !1, this.visible_ = this.data_?.visible ?? !0, this.isClampToGround_ = this.data_?.isClampToGround ?? !1, this.isHighlight_ = this.data_?.isHighlight ?? !1, this.isInterpolation_ = this.data_?.isInterpolation ?? !1;
166395
166399
  const A = k.getMapEngineInstance(this.containerID_);
166396
166400
  let e = [], t = !1, i = !1;
166397
166401
  const r = this.data_.coordinates;
@@ -166407,13 +166411,38 @@ class fWA {
166407
166411
  this.reDrawCenterLabel(o.position), this.reDrawCenterHTML(o.position);
166408
166412
  } else
166409
166413
  this.reDrawCenterLabel(s.position), this.reDrawCenterHTML(s.position);
166410
- if (t || this.clearCustomLabel(), i || this.clearCustomHTML(), !(!t && !i))
166411
- if (this.isClampToGround_) {
166412
- const o = await k.getTerrainHeights(A, r);
166413
- this.reDrawCustomLabel(o.positions), this.reDrawCustomHTML(o.positions);
166414
- } else
166415
- this.reDrawCustomLabel(e), this.reDrawCustomHTML(e);
166414
+ if (t || this.clearCustomLabel(), i || this.clearCustomHTML(), !t && !i) {
166415
+ this.judgmentVisual();
166416
+ return;
166417
+ }
166418
+ if (this.isClampToGround_) {
166419
+ const o = await k.getTerrainHeights(A, r);
166420
+ this.reDrawCustomLabel(o.positions), this.reDrawCustomHTML(o.positions);
166421
+ } else
166422
+ this.reDrawCustomLabel(e), this.reDrawCustomHTML(e);
166423
+ this.judgmentVisual();
166416
166424
  }
166425
+ judgmentVisual = () => {
166426
+ if (!(!this.isJudgmentVisual_ || !this.visible_) && window.cameraCullingVolume) {
166427
+ this.boundingSphere_ || (this.boundingSphere_ = Cesium.BoundingSphere.fromPoints(
166428
+ this.geometryInstance_?.geometryInstances?.geometry?._positions
166429
+ ));
166430
+ const A = window.cameraCullingVolume.computeVisibility(
166431
+ this.boundingSphere_
166432
+ );
166433
+ let e = !0;
166434
+ if (A === Cesium.Intersect.OUTSIDE && (e = !1), this.geometryInstance_ && (this.geometryInstance_.show = e), this.modelInstance_) {
166435
+ const t = PA.cloneDeep(this.modelInstance_.data_);
166436
+ t.visible = e, t?.frustum?.visible && (t.frustum.visible = e), this.modelInstance_.DataProcessing(t);
166437
+ }
166438
+ if (this.centerLabelInstance_ && (this.centerLabelInstance_.show = e), this.centerHTMLInstance_ && (e ? this.centerHTMLInstance_.presentationMode_ === 1 || this.centerHTMLInstance_.presentationMode_ === 2 && this.centerHTMLInstance_.isHighlight ? this.centerHTMLInstance_.show() : this.centerHTMLInstance_.hide() : this.centerHTMLInstance_.hide()), Array.isArray(this.customLabelInstances_))
166439
+ for (const t of this.customLabelInstances_)
166440
+ t.primitive.show = e;
166441
+ if (Array.isArray(this.customHTMLInstances_))
166442
+ for (const t of this.customHTMLInstances_)
166443
+ e && (t.presentationMode_ === 1 || t.presentationMode_ === 2 && t.isHighlight) ? t.show() : t.hide();
166444
+ }
166445
+ };
166417
166446
  /**
166418
166447
  * 创建虚线几何图元
166419
166448
  * @param {Cesium.Viewer} cesiumViewer - Cesium视图实例
@@ -166449,8 +166478,8 @@ class fWA {
166449
166478
  }
166450
166479
  }
166451
166480
  });
166452
- var o, a;
166453
- this.isClampToGround_ ? (o = A.scene.groundPrimitives, a = new Cesium.GroundPolylinePrimitive({
166481
+ var o;
166482
+ this.isClampToGround_ ? o = new Cesium.GroundPolylinePrimitive({
166454
166483
  geometryInstances: new Cesium.GeometryInstance({
166455
166484
  id: t,
166456
166485
  geometry: new Cesium.GroundPolylineGeometry({
@@ -166462,8 +166491,9 @@ class fWA {
166462
166491
  material: s
166463
166492
  }),
166464
166493
  show: this.visible_,
166465
- asynchronous: !1
166466
- })) : (o = A.scene.primitives, a = new Cesium.Primitive({
166494
+ asynchronous: !1,
166495
+ releaseGeometryInstances: !1
166496
+ }) : o = new Cesium.Primitive({
166467
166497
  geometryInstances: new Cesium.GeometryInstance({
166468
166498
  id: t,
166469
166499
  geometry: new Cesium.PolylineGeometry({
@@ -166475,8 +166505,11 @@ class fWA {
166475
166505
  material: s
166476
166506
  }),
166477
166507
  show: this.visible_,
166478
- asynchronous: !1
166479
- })), this.geometryInstance_ && o.remove(this.geometryInstance_), this.geometryInstance_ = o.add(a);
166508
+ asynchronous: !1,
166509
+ releaseGeometryInstances: !1
166510
+ });
166511
+ const a = A.scene.primitives;
166512
+ this.geometryInstance_ && a.remove(this.geometryInstance_), this.geometryInstance_ = a.add(o);
166480
166513
  }
166481
166514
  /**
166482
166515
  * 创建模型动画
@@ -166773,8 +166806,7 @@ class fWA {
166773
166806
  this.clearGeometry(), this.clearModel(), this.clearCenterLabel(), this.clearCenterHTML(), this.clearCustomLabel(), this.clearCustomHTML();
166774
166807
  };
166775
166808
  clearGeometry = () => {
166776
- let A = k.getMapEngineInstance(this.containerID_);
166777
- this.geometryInstance_ && A && A?.scene && A?.scene?.primitives && (this.isClampToGround_ ? A.scene.groundPrimitives.remove(this.geometryInstance_) : A.scene.primitives.remove(this.geometryInstance_)), this.geometryInstance_ = void 0;
166809
+ this.geometryInstance_ && k.getMapEngineInstance(this.containerID_).scene.primitives.remove(this.geometryInstance_), this.geometryInstance_ = void 0;
166778
166810
  };
166779
166811
  clearModel = () => {
166780
166812
  this.modelInstance_ && this.modelInstance_.clear(), this.modelInstance_ = void 0, this.sampledPosition_ && (this.sampledPosition_ = void 0);
@@ -195898,25 +195930,25 @@ const xte = (n, A) => {
195898
195930
  e.directionWC,
195899
195931
  e.upWC
195900
195932
  )), !window.isStartMapModeChange) {
195901
- const l = A.canvas, D = e.pickEllipsoid(
195902
- new Cesium.Cartesian2(l.width / 2, l.height / 2)
195903
- ), P = k.transformCoordinate(D);
195904
- P && (this.MapEngine_Temp.center = {
195905
- longitude: P.longitude,
195906
- latitude: P.latitude
195933
+ const D = A.canvas, P = e.pickEllipsoid(
195934
+ new Cesium.Cartesian2(D.width / 2, D.height / 2)
195935
+ ), c = k.transformCoordinate(P);
195936
+ c && (this.MapEngine_Temp.center = {
195937
+ longitude: c.longitude,
195938
+ latitude: c.latitude
195907
195939
  });
195908
195940
  }
195909
195941
  !this.isLoadInitMapTerrainHeight && window.mousePosition && k.getTerrainHeight(n, window.mousePosition).then(
195910
- (l) => {
195911
- window.mousePosition = l.position, this.isLoadInitMapTerrainHeight = !0, this.initializeMap || (this.setMapEngineStateBar(), this.refreshZoom());
195942
+ (D) => {
195943
+ window.mousePosition = D.position, this.isLoadInitMapTerrainHeight = !0, this.initializeMap || (this.setMapEngineStateBar(), this.refreshZoom());
195912
195944
  }
195913
195945
  ), this.MapEngine_Temp.camera = {
195914
195946
  heading: parseInt(Cesium.Math.toDegrees(e.heading)),
195915
195947
  pitch: parseInt(Cesium.Math.toDegrees(e.pitch))
195916
195948
  }, window.isOpenSyncZoomLensCamera || (this.syncZoom(k.getZoom(this.containerID)), this.setMapEngineStateBar(), this.refreshZoom());
195917
- const t = k.getAnnotations(), i = k.getModels(), r = k.getPipeLines(), s = k.getCustomNoFlyZones(), o = k.getAirRoutes(), a = k.getNoFlys();
195918
- for (const l of [...t.values(), ...i.values(), ...r.values(), ...s.values(), ...o.values(), ...a.values()])
195919
- l.hasOwnProperty("judgmentVisual") && l?.isJudgmentVisual_ && l.judgmentVisual();
195949
+ const t = k.getAnnotations(), i = k.getModels(), r = k.getPipeLines(), s = k.getCustomNoFlyZones(), o = k.getAirRoutes(), a = k.getNoFlys(), l = k.getFlightPaths();
195950
+ for (const D of [...t.values(), ...i.values(), ...r.values(), ...s.values(), ...o.values(), ...a.values(), ...l.values()])
195951
+ D.hasOwnProperty("judgmentVisual") && D?.isJudgmentVisual_ && D.judgmentVisual();
195920
195952
  },
195921
195953
  cesiumScenePostRender(n) {
195922
195954
  this.stats && this.stats.update();