zywlgis 0.5.41 → 0.5.43

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.
@@ -134765,7 +134765,10 @@ class k {
134765
134765
  let i = e.map(async (r) => {
134766
134766
  if (t === Cesium.ClassificationType.BOTH || t === Cesium.ClassificationType.CESIUM_3D_TILE) {
134767
134767
  let s = this.transformCartographic(r);
134768
- return s.height = A.scene.sampleHeight(s), this.transformCartesian3(s);
134768
+ return A.scene.sampleHeight(s) === void 0 ? s = (await this.calculateTerrainHeight(
134769
+ A,
134770
+ r
134771
+ )).position : s.height = A.scene.sampleHeight(s), this.transformCartesian3(s);
134769
134772
  } else return t === Cesium.ClassificationType.TERRAIN ? (await this.calculateTerrainHeight(
134770
134773
  A,
134771
134774
  r
@@ -161058,7 +161061,7 @@ function MoA(...n) {
161058
161061
  return new IoA(...n);
161059
161062
  }
161060
161063
  MoA.localizePositions = IoA.localizePositions;
161061
- const WqA = "0.5.41", _qA = {
161064
+ const WqA = "0.5.43", _qA = {
161062
161065
  version: WqA
161063
161066
  }, hU = {
161064
161067
  POINTERMOVE: "pointermove",
@@ -165842,12 +165845,14 @@ class QWA {
165842
165845
  geometryInstances: w,
165843
165846
  appearance: u,
165844
165847
  show: this.visible_,
165845
- asynchronous: !1
165848
+ asynchronous: !1,
165849
+ releaseGeometryInstances: !1
165846
165850
  }) : c = new Cesium.Primitive({
165847
165851
  geometryInstances: w,
165848
165852
  appearance: u,
165849
165853
  show: this.visible_,
165850
- asynchronous: !1
165854
+ asynchronous: !1,
165855
+ releaseGeometryInstances: !1
165851
165856
  });
165852
165857
  const Q = new Cesium.PolylineMaterialAppearance({
165853
165858
  material: new Cesium.Material({
@@ -165873,7 +165878,8 @@ class QWA {
165873
165878
  geometryInstances: v,
165874
165879
  appearance: Q,
165875
165880
  show: this.visible_,
165876
- asynchronous: !1
165881
+ asynchronous: !1,
165882
+ releaseGeometryInstances: !1
165877
165883
  });
165878
165884
  } else {
165879
165885
  const v = new Cesium.GeometryInstance({
@@ -165887,7 +165893,8 @@ class QWA {
165887
165893
  geometryInstances: v,
165888
165894
  appearance: Q,
165889
165895
  show: this.visible_,
165890
- asynchronous: !1
165896
+ asynchronous: !1,
165897
+ releaseGeometryInstances: !1
165891
165898
  });
165892
165899
  }
165893
165900
  this.geometryInstance_ && g.remove(this.geometryInstance_), c && (this.geometryInstance_ = g.add(c)), this.geometryOutlineInstance_ && g.remove(this.geometryOutlineInstance_), h && (this.geometryOutlineInstance_ = g.add(
@@ -166354,6 +166361,10 @@ class fWA {
166354
166361
  stopTime_ = void 0;
166355
166362
  velocityOrientationProperty_ = void 0;
166356
166363
  initLoadModel_ = !0;
166364
+ isJudgmentVisual_ = !1;
166365
+ // 是否启用视锥判断(控制是否启用视锥判断)
166366
+ boundingSphere_ = void 0;
166367
+ // 视锥判断的包围球
166357
166368
  /**
166358
166369
  * 构造函数
166359
166370
  * @param {string} containerID - 地图容器ID
@@ -166391,7 +166402,7 @@ class fWA {
166391
166402
  this.clear();
166392
166403
  return;
166393
166404
  }
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;
166405
+ 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
166406
  const A = k.getMapEngineInstance(this.containerID_);
166396
166407
  let e = [], t = !1, i = !1;
166397
166408
  const r = this.data_.coordinates;
@@ -166407,13 +166418,38 @@ class fWA {
166407
166418
  this.reDrawCenterLabel(o.position), this.reDrawCenterHTML(o.position);
166408
166419
  } else
166409
166420
  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);
166421
+ if (t || this.clearCustomLabel(), i || this.clearCustomHTML(), !t && !i) {
166422
+ this.judgmentVisual();
166423
+ return;
166424
+ }
166425
+ if (this.isClampToGround_) {
166426
+ const o = await k.getTerrainHeights(A, r);
166427
+ this.reDrawCustomLabel(o.positions), this.reDrawCustomHTML(o.positions);
166428
+ } else
166429
+ this.reDrawCustomLabel(e), this.reDrawCustomHTML(e);
166430
+ this.judgmentVisual();
166416
166431
  }
166432
+ judgmentVisual = () => {
166433
+ if (!(!this.isJudgmentVisual_ || !this.visible_) && window.cameraCullingVolume) {
166434
+ this.boundingSphere_ || (this.boundingSphere_ = Cesium.BoundingSphere.fromPoints(
166435
+ this.geometryInstance_?.geometryInstances?.geometry?._positions
166436
+ ));
166437
+ const A = window.cameraCullingVolume.computeVisibility(
166438
+ this.boundingSphere_
166439
+ );
166440
+ let e = !0;
166441
+ if (A === Cesium.Intersect.OUTSIDE && (e = !1), this.geometryInstance_ && (this.geometryInstance_.show = e), this.modelInstance_) {
166442
+ const t = PA.cloneDeep(this.modelInstance_.data_);
166443
+ t.visible = e, t?.frustum?.visible && (t.frustum.visible = e), this.modelInstance_.DataProcessing(t);
166444
+ }
166445
+ 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_))
166446
+ for (const t of this.customLabelInstances_)
166447
+ t.primitive.show = e;
166448
+ if (Array.isArray(this.customHTMLInstances_))
166449
+ for (const t of this.customHTMLInstances_)
166450
+ e && (t.presentationMode_ === 1 || t.presentationMode_ === 2 && t.isHighlight) ? t.show() : t.hide();
166451
+ }
166452
+ };
166417
166453
  /**
166418
166454
  * 创建虚线几何图元
166419
166455
  * @param {Cesium.Viewer} cesiumViewer - Cesium视图实例
@@ -166449,8 +166485,8 @@ class fWA {
166449
166485
  }
166450
166486
  }
166451
166487
  });
166452
- var o, a;
166453
- this.isClampToGround_ ? (o = A.scene.groundPrimitives, a = new Cesium.GroundPolylinePrimitive({
166488
+ var o;
166489
+ this.isClampToGround_ ? o = new Cesium.GroundPolylinePrimitive({
166454
166490
  geometryInstances: new Cesium.GeometryInstance({
166455
166491
  id: t,
166456
166492
  geometry: new Cesium.GroundPolylineGeometry({
@@ -166462,8 +166498,9 @@ class fWA {
166462
166498
  material: s
166463
166499
  }),
166464
166500
  show: this.visible_,
166465
- asynchronous: !1
166466
- })) : (o = A.scene.primitives, a = new Cesium.Primitive({
166501
+ asynchronous: !1,
166502
+ releaseGeometryInstances: !1
166503
+ }) : o = new Cesium.Primitive({
166467
166504
  geometryInstances: new Cesium.GeometryInstance({
166468
166505
  id: t,
166469
166506
  geometry: new Cesium.PolylineGeometry({
@@ -166475,8 +166512,11 @@ class fWA {
166475
166512
  material: s
166476
166513
  }),
166477
166514
  show: this.visible_,
166478
- asynchronous: !1
166479
- })), this.geometryInstance_ && o.remove(this.geometryInstance_), this.geometryInstance_ = o.add(a);
166515
+ asynchronous: !1,
166516
+ releaseGeometryInstances: !1
166517
+ });
166518
+ const a = A.scene.primitives;
166519
+ this.geometryInstance_ && a.remove(this.geometryInstance_), this.geometryInstance_ = a.add(o);
166480
166520
  }
166481
166521
  /**
166482
166522
  * 创建模型动画
@@ -166773,8 +166813,7 @@ class fWA {
166773
166813
  this.clearGeometry(), this.clearModel(), this.clearCenterLabel(), this.clearCenterHTML(), this.clearCustomLabel(), this.clearCustomHTML();
166774
166814
  };
166775
166815
  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;
166816
+ this.geometryInstance_ && k.getMapEngineInstance(this.containerID_).scene.primitives.remove(this.geometryInstance_), this.geometryInstance_ = void 0;
166778
166817
  };
166779
166818
  clearModel = () => {
166780
166819
  this.modelInstance_ && this.modelInstance_.clear(), this.modelInstance_ = void 0, this.sampledPosition_ && (this.sampledPosition_ = void 0);
@@ -167501,6 +167540,7 @@ class CWA {
167501
167540
  appearance: c,
167502
167541
  show: this.visible_,
167503
167542
  asynchronous: !1,
167543
+ releaseGeometryInstances: !1,
167504
167544
  classificationType: Cesium.ClassificationType.TERRAIN
167505
167545
  }), P = new Cesium.GroundPolylinePrimitive({
167506
167546
  geometryInstances: new Cesium.GeometryInstance({
@@ -167513,6 +167553,7 @@ class CWA {
167513
167553
  appearance: h,
167514
167554
  show: this.visible_,
167515
167555
  asynchronous: !1,
167556
+ releaseGeometryInstances: !1,
167516
167557
  classificationType: Cesium.ClassificationType.TERRAIN
167517
167558
  })) : (D = new Cesium.Primitive({
167518
167559
  geometryInstances: new Cesium.GeometryInstance({
@@ -167525,7 +167566,8 @@ class CWA {
167525
167566
  }),
167526
167567
  appearance: c,
167527
167568
  show: this.visible_,
167528
- asynchronous: !1
167569
+ asynchronous: !1,
167570
+ releaseGeometryInstances: !1
167529
167571
  }), P = new Cesium.Primitive({
167530
167572
  geometryInstances: new Cesium.GeometryInstance({
167531
167573
  id: i,
@@ -167536,7 +167578,8 @@ class CWA {
167536
167578
  }),
167537
167579
  appearance: h,
167538
167580
  show: this.visible_,
167539
- asynchronous: !1
167581
+ asynchronous: !1,
167582
+ releaseGeometryInstances: !1
167540
167583
  })), this.geometryInstance_ && l.remove(this.geometryInstance_), this.geometryInstance_ = l.add(D), this.geometryOutlineInstance_ && l.remove(this.geometryOutlineInstance_), this.geometryOutlineInstance_ = l.add(P);
167541
167584
  } else {
167542
167585
  this.clearGeometry();
@@ -171815,12 +171858,14 @@ class BWA {
171815
171858
  appearance: h,
171816
171859
  show: this.visible_,
171817
171860
  asynchronous: !1,
171861
+ releaseGeometryInstances: !1,
171818
171862
  classificationType: this.isClampTo3DTILE_ ? Cesium.ClassificationType.BOTH : Cesium.ClassificationType.TERRAIN
171819
171863
  }) : D = new Cesium.Primitive({
171820
171864
  geometryInstances: g,
171821
171865
  appearance: h,
171822
171866
  show: this.visible_,
171823
- asynchronous: !1
171867
+ asynchronous: !1,
171868
+ releaseGeometryInstances: !1
171824
171869
  });
171825
171870
  const u = new Cesium.PolylineMaterialAppearance({
171826
171871
  material: new Cesium.Material({
@@ -171847,6 +171892,7 @@ class BWA {
171847
171892
  appearance: u,
171848
171893
  show: this.visible_,
171849
171894
  asynchronous: !1,
171895
+ releaseGeometryInstances: !1,
171850
171896
  classificationType: this.isClampTo3DTILE_ ? Cesium.ClassificationType.BOTH : Cesium.ClassificationType.TERRAIN
171851
171897
  });
171852
171898
  } else {
@@ -171861,7 +171907,8 @@ class BWA {
171861
171907
  geometryInstances: w,
171862
171908
  appearance: u,
171863
171909
  show: this.visible_,
171864
- asynchronous: !1
171910
+ asynchronous: !1,
171911
+ releaseGeometryInstances: !1
171865
171912
  });
171866
171913
  }
171867
171914
  this.geometryInstance_ && c.remove(this.geometryInstance_), D && (this.geometryInstance_ = c.add(D)), this.geometryOutlineInstance_ && c.remove(this.geometryOutlineInstance_), P && (this.geometryOutlineInstance_ = c.add(
@@ -177444,12 +177491,14 @@ class xWA {
177444
177491
  appearance: v,
177445
177492
  show: this.visible_,
177446
177493
  asynchronous: !1,
177494
+ releaseGeometryInstances: !1,
177447
177495
  classificationType: this.isClampTo3DTILE_ ? Cesium.ClassificationType.BOTH : Cesium.ClassificationType.TERRAIN
177448
177496
  }) : u = new Cesium.Primitive({
177449
177497
  geometryInstances: E,
177450
177498
  appearance: v,
177451
177499
  show: this.visible_,
177452
- asynchronous: !1
177500
+ asynchronous: !1,
177501
+ releaseGeometryInstances: !1
177453
177502
  }), this.isClampToGround_ || this.isClampTo3DTILE_) {
177454
177503
  const p = new Cesium.GeometryInstance({
177455
177504
  id: i,
@@ -177463,6 +177512,7 @@ class xWA {
177463
177512
  appearance: this.polylineAppearance,
177464
177513
  show: this.visible_,
177465
177514
  asynchronous: !1,
177515
+ releaseGeometryInstances: !1,
177466
177516
  classificationType: this.isClampTo3DTILE_ ? Cesium.ClassificationType.BOTH : Cesium.ClassificationType.TERRAIN
177467
177517
  });
177468
177518
  } else {
@@ -177477,7 +177527,8 @@ class xWA {
177477
177527
  geometryInstances: p,
177478
177528
  appearance: this.polylineAppearance,
177479
177529
  show: this.visible_,
177480
- asynchronous: !1
177530
+ asynchronous: !1,
177531
+ releaseGeometryInstances: !1
177481
177532
  });
177482
177533
  }
177483
177534
  this.geometryInstance_ && Q.remove(this.geometryInstance_), u && (this.geometryInstance_ = Q.add(u)), this.geometryOutlineInstance_ && Q.remove(this.geometryOutlineInstance_), w && (this.geometryOutlineInstance_ = Q.add(
@@ -195898,25 +195949,25 @@ const xte = (n, A) => {
195898
195949
  e.directionWC,
195899
195950
  e.upWC
195900
195951
  )), !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
195952
+ const D = A.canvas, P = e.pickEllipsoid(
195953
+ new Cesium.Cartesian2(D.width / 2, D.height / 2)
195954
+ ), c = k.transformCoordinate(P);
195955
+ c && (this.MapEngine_Temp.center = {
195956
+ longitude: c.longitude,
195957
+ latitude: c.latitude
195907
195958
  });
195908
195959
  }
195909
195960
  !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());
195961
+ (D) => {
195962
+ window.mousePosition = D.position, this.isLoadInitMapTerrainHeight = !0, this.initializeMap || (this.setMapEngineStateBar(), this.refreshZoom());
195912
195963
  }
195913
195964
  ), this.MapEngine_Temp.camera = {
195914
195965
  heading: parseInt(Cesium.Math.toDegrees(e.heading)),
195915
195966
  pitch: parseInt(Cesium.Math.toDegrees(e.pitch))
195916
195967
  }, 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();
195968
+ const t = k.getAnnotations(), i = k.getModels(), r = k.getPipeLines(), s = k.getCustomNoFlyZones(), o = k.getAirRoutes(), a = k.getNoFlys(), l = k.getFlightPaths();
195969
+ for (const D of [...t.values(), ...i.values(), ...r.values(), ...s.values(), ...o.values(), ...a.values(), ...l.values()])
195970
+ D.hasOwnProperty("judgmentVisual") && D?.isJudgmentVisual_ && D.judgmentVisual();
195920
195971
  },
195921
195972
  cesiumScenePostRender(n) {
195922
195973
  this.stats && this.stats.update();
@@ -196937,7 +196988,7 @@ const xte = (n, A) => {
196937
196988
  }
196938
196989
  ).then((a) => {
196939
196990
  console.log("新增完成");
196940
- }), console.log(`新增了${n}数据>>>>>>>>>>`, o));
196991
+ }), console.log(`新增了${n}数据>>>>>>>>>>`, o), alert("加载完成"));
196941
196992
  });
196942
196993
  },
196943
196994
  async setZYWLAnnotations(n, A) {