bruce-cesium 2.8.7 → 2.8.8

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.
@@ -3803,12 +3803,12 @@
3803
3803
  return __generator(this, function (_h) {
3804
3804
  switch (_h.label) {
3805
3805
  case 0:
3806
+ this.removeLabel();
3806
3807
  pos3d = starterPos3d ? starterPos3d.clone() : null;
3807
3808
  counter = ++this.counter;
3808
3809
  if (this.disposed) {
3809
3810
  return [2 /*return*/];
3810
3811
  }
3811
- this.removeLabel();
3812
3812
  sizeInM = 0;
3813
3813
  heightRef = null;
3814
3814
  pixelOffset = new Cesium.Cartesian2(0, -5);
@@ -3943,7 +3943,7 @@
3943
3943
  case 1:
3944
3944
  pos3d = _h.sent();
3945
3945
  heightRef = Cesium.HeightReference.NONE;
3946
- if (this.counter != counter) {
3946
+ if (this.counter != counter || this.disposed) {
3947
3947
  return [2 /*return*/];
3948
3948
  }
3949
3949
  _h.label = 2;
@@ -4000,11 +4000,17 @@
4000
4000
  if (this.disposed || this.counter != counter) {
4001
4001
  return [2 /*return*/];
4002
4002
  }
4003
- ele = document.createElement("div");
4004
- ele.innerHTML = text;
4005
- ele.setAttribute("style", "\n position: absolute;\n z-index: 0;\n display: none;\n pointer-events: none;\n padding: 6px 8px;\n border-radius: 6px;\n font-family: Arial;\n font-size: 12px;\n -webkit-backdrop-filter: blur(20px);\n backdrop-filter: blur(20px);\n background: rgba(33,39,42,.8);\n border-radius: 9px;\n box-shadow: 0 0 1px rgba(18,22,25,.36),0 18px 36px -4px rgba(18,22,25,.36);\n color: #ffffff;\n }");
4006
- this.label = ele;
4007
- this.viewer.container.appendChild(ele);
4003
+ ele = null;
4004
+ if (this.label) {
4005
+ ele = this.label;
4006
+ }
4007
+ else {
4008
+ ele = document.createElement("div");
4009
+ ele.innerHTML = text;
4010
+ ele.setAttribute("style", "\n position: absolute;\n z-index: 0;\n display: none;\n pointer-events: none;\n padding: 6px 8px;\n border-radius: 6px;\n font-family: Arial;\n font-size: 12px;\n -webkit-backdrop-filter: blur(20px);\n backdrop-filter: blur(20px);\n background: rgba(33,39,42,.8);\n border-radius: 9px;\n box-shadow: 0 0 1px rgba(18,22,25,.36),0 18px 36px -4px rgba(18,22,25,.36);\n color: #ffffff;\n }");
4011
+ this.label = ele;
4012
+ this.viewer.container.appendChild(ele);
4013
+ }
4008
4014
  _lastDistance = null;
4009
4015
  _lastCameraPos = null;
4010
4016
  getDistance = function () {
@@ -4107,12 +4113,12 @@
4107
4113
  updateLabel();
4108
4114
  terrTimeout = null;
4109
4115
  this.terrChangedRemoval = this.viewer.scene.terrainProviderChanged.addEventListener(function () {
4110
- if (_this.disposed) {
4116
+ clearTimeout(terrTimeout);
4117
+ if (_this.disposed || _this.counter != counter) {
4111
4118
  return;
4112
4119
  }
4113
- clearTimeout(terrTimeout);
4114
4120
  terrTimeout = setTimeout(function () {
4115
- if (counter != _this.counter) {
4121
+ if (_this.disposed || counter != _this.counter) {
4116
4122
  return;
4117
4123
  }
4118
4124
  _this.createLabel(starterPos3d);
@@ -4346,6 +4352,11 @@
4346
4352
  });
4347
4353
  }
4348
4354
  }
4355
+ else {
4356
+ exports.EntityLabel.Detatch({
4357
+ rego: rego
4358
+ });
4359
+ }
4349
4360
  }
4350
4361
  }
4351
4362
  function markEntity(register, rego, visual, ignoreParent) {
@@ -4940,6 +4951,9 @@
4940
4951
  if (shouldRetain) {
4941
4952
  continue;
4942
4953
  }
4954
+ exports.EntityLabel.Detatch({
4955
+ rego: rego
4956
+ });
4943
4957
  removeEntity(this.viewer, rego.visual);
4944
4958
  var doesInclude = this.rego[entityId_4].find(function (r) { return r.menuItemId === menuItemId; });
4945
4959
  if (doesInclude) {
@@ -4968,6 +4982,9 @@
4968
4982
  if (!rego) {
4969
4983
  return { value: void 0 };
4970
4984
  }
4985
+ exports.EntityLabel.Detatch({
4986
+ rego: rego
4987
+ });
4971
4988
  removeEntity(this_2.viewer, rego.visual);
4972
4989
  (_b = this_2.onUpdate) === null || _b === void 0 ? void 0 : _b.Trigger({
4973
4990
  type: EVisualUpdateType.Remove,
@@ -4995,6 +5012,9 @@
4995
5012
  if (!rego) {
4996
5013
  continue;
4997
5014
  }
5015
+ exports.EntityLabel.Detatch({
5016
+ rego: rego
5017
+ });
4998
5018
  removeEntity(this.viewer, rego.visual);
4999
5019
  this.rego[entityId_5] = entityRegos.filter(function (r) { return r.menuItemId !== menuItemId; });
5000
5020
  (_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger({
@@ -5015,7 +5035,7 @@
5015
5035
  /**
5016
5036
  * Returns an array of drilled visuals associated with this register.
5017
5037
  * The top array item is the first found.
5018
- * @param cursor
5038
+ * @param params
5019
5039
  * @returns
5020
5040
  */
5021
5041
  Register.prototype.GetRegosFromCursor = function (params) {
@@ -10362,8 +10382,7 @@
10362
10382
  /**
10363
10383
  * Disables a menu item by its id.
10364
10384
  * This will disable all children as well.
10365
- * @param id
10366
- * @param recursive
10385
+ * @param params
10367
10386
  */
10368
10387
  Manager.prototype.RemoveItemById = function (params) {
10369
10388
  var _a, _b;
@@ -12842,7 +12861,7 @@
12842
12861
  function renderNavigator(iteration, params, bookmark, view) {
12843
12862
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
12844
12863
  return __awaiter(this, void 0, void 0, function () {
12845
- var viewer, scene, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, labelledIds, entityOpacityMap, entityId, opacity, imagery, renderedRelationEntityIds, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem, gOcclusion;
12864
+ var viewer, scene, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, labelledIds, curLabelledIds, toUnLabel, entityOpacityMap, entityId, opacity, imagery, renderedRelationEntityIds, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem, gOcclusion;
12846
12865
  return __generator(this, function (_7) {
12847
12866
  switch (_7.label) {
12848
12867
  case 0:
@@ -13070,15 +13089,24 @@
13070
13089
  entityIds: isolatedIds
13071
13090
  });
13072
13091
  }
13073
- params.manager.VisualsRegister.ClearLabelled();
13074
13092
  labelledIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.labelledEntityIds;
13075
13093
  if (labelledIds == null) {
13076
13094
  labelledIds = (_2 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _2 === void 0 ? void 0 : _2.labelledEntityIds;
13077
13095
  }
13078
- if (labelledIds != null) {
13096
+ if (!(labelledIds === null || labelledIds === void 0 ? void 0 : labelledIds.length)) {
13097
+ params.manager.VisualsRegister.ClearLabelled();
13098
+ }
13099
+ else {
13100
+ curLabelledIds = params.manager.VisualsRegister.GetLabelled();
13079
13101
  params.manager.VisualsRegister.SetLabelled({
13080
13102
  labelled: true,
13081
- entityIds: labelledIds
13103
+ entityIds: labelledIds,
13104
+ requestRender: false
13105
+ });
13106
+ toUnLabel = curLabelledIds.filter(function (id) { return labelledIds.indexOf(id) === -1; });
13107
+ params.manager.VisualsRegister.SetLabelled({
13108
+ labelled: false,
13109
+ entityIds: toUnLabel
13082
13110
  });
13083
13111
  }
13084
13112
  params.manager.VisualsRegister.ClearOpacity();
@@ -16075,7 +16103,7 @@
16075
16103
  ViewerUtils.CreateWidgets = CreateWidgets;
16076
16104
  })(exports.ViewerUtils || (exports.ViewerUtils = {}));
16077
16105
 
16078
- var VERSION$1 = "2.8.7";
16106
+ var VERSION$1 = "2.8.8";
16079
16107
 
16080
16108
  exports.VERSION = VERSION$1;
16081
16109
  exports.CesiumViewMonitor = CesiumViewMonitor;