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.
@@ -1,6 +1,6 @@
1
1
  import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, DelayQueue, BatchedDataGetter, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, JulianDate, SceneMode, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, SceneTransforms, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, KmlDataSource, PolygonPipeline, OrthographicFrustum, EasingFunction, Cesium3DTileset, Matrix4, Matrix3, IonResource, Ion, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, Model, CesiumInspector, ScreenSpaceEventHandler, ScreenSpaceEventType, ColorMaterialProperty, GeometryInstance, BoundingSphere } from 'cesium';
3
+ import { Cartographic, JulianDate, Color, HeightReference, Cartesian3, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Math as Math$1, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cartesian2, CallbackProperty, Rectangle, SceneMode, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumInspector, defined, Cesium3DTileset, Matrix4, Matrix3, IonResource, Ion, EllipsoidGeodesic, sampleTerrainMostDetailed, Model, PolygonPipeline, ColorMaterialProperty, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere } from 'cesium';
4
4
 
5
5
  var TIME_LAG = 300;
6
6
  var POSITION_CHECK_TIMER = 950;
@@ -3810,12 +3810,12 @@ var EntityLabel;
3810
3810
  return __generator(this, function (_h) {
3811
3811
  switch (_h.label) {
3812
3812
  case 0:
3813
+ this.removeLabel();
3813
3814
  pos3d = starterPos3d ? starterPos3d.clone() : null;
3814
3815
  counter = ++this.counter;
3815
3816
  if (this.disposed) {
3816
3817
  return [2 /*return*/];
3817
3818
  }
3818
- this.removeLabel();
3819
3819
  sizeInM = 0;
3820
3820
  heightRef = null;
3821
3821
  pixelOffset = new Cartesian2(0, -5);
@@ -3950,7 +3950,7 @@ var EntityLabel;
3950
3950
  case 1:
3951
3951
  pos3d = _h.sent();
3952
3952
  heightRef = HeightReference.NONE;
3953
- if (this.counter != counter) {
3953
+ if (this.counter != counter || this.disposed) {
3954
3954
  return [2 /*return*/];
3955
3955
  }
3956
3956
  _h.label = 2;
@@ -4007,11 +4007,17 @@ var EntityLabel;
4007
4007
  if (this.disposed || this.counter != counter) {
4008
4008
  return [2 /*return*/];
4009
4009
  }
4010
- ele = document.createElement("div");
4011
- ele.innerHTML = text;
4012
- 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 }");
4013
- this.label = ele;
4014
- this.viewer.container.appendChild(ele);
4010
+ ele = null;
4011
+ if (this.label) {
4012
+ ele = this.label;
4013
+ }
4014
+ else {
4015
+ ele = document.createElement("div");
4016
+ ele.innerHTML = text;
4017
+ 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 }");
4018
+ this.label = ele;
4019
+ this.viewer.container.appendChild(ele);
4020
+ }
4015
4021
  _lastDistance = null;
4016
4022
  _lastCameraPos = null;
4017
4023
  getDistance = function () {
@@ -4114,12 +4120,12 @@ var EntityLabel;
4114
4120
  updateLabel();
4115
4121
  terrTimeout = null;
4116
4122
  this.terrChangedRemoval = this.viewer.scene.terrainProviderChanged.addEventListener(function () {
4117
- if (_this.disposed) {
4123
+ clearTimeout(terrTimeout);
4124
+ if (_this.disposed || _this.counter != counter) {
4118
4125
  return;
4119
4126
  }
4120
- clearTimeout(terrTimeout);
4121
4127
  terrTimeout = setTimeout(function () {
4122
- if (counter != _this.counter) {
4128
+ if (_this.disposed || counter != _this.counter) {
4123
4129
  return;
4124
4130
  }
4125
4131
  _this.createLabel(starterPos3d);
@@ -4353,6 +4359,11 @@ function updateEntity(viewer, entityId, register) {
4353
4359
  });
4354
4360
  }
4355
4361
  }
4362
+ else {
4363
+ EntityLabel.Detatch({
4364
+ rego: rego
4365
+ });
4366
+ }
4356
4367
  }
4357
4368
  }
4358
4369
  function markEntity(register, rego, visual, ignoreParent) {
@@ -4952,6 +4963,9 @@ var VisualsRegister;
4952
4963
  if (shouldRetain) {
4953
4964
  continue;
4954
4965
  }
4966
+ EntityLabel.Detatch({
4967
+ rego: rego
4968
+ });
4955
4969
  removeEntity(this.viewer, rego.visual);
4956
4970
  var doesInclude = this.rego[entityId_4].find(function (r) { return r.menuItemId === menuItemId; });
4957
4971
  if (doesInclude) {
@@ -4980,6 +4994,9 @@ var VisualsRegister;
4980
4994
  if (!rego) {
4981
4995
  return { value: void 0 };
4982
4996
  }
4997
+ EntityLabel.Detatch({
4998
+ rego: rego
4999
+ });
4983
5000
  removeEntity(this_2.viewer, rego.visual);
4984
5001
  (_b = this_2.onUpdate) === null || _b === void 0 ? void 0 : _b.Trigger({
4985
5002
  type: EVisualUpdateType.Remove,
@@ -5007,6 +5024,9 @@ var VisualsRegister;
5007
5024
  if (!rego) {
5008
5025
  continue;
5009
5026
  }
5027
+ EntityLabel.Detatch({
5028
+ rego: rego
5029
+ });
5010
5030
  removeEntity(this.viewer, rego.visual);
5011
5031
  this.rego[entityId_5] = entityRegos.filter(function (r) { return r.menuItemId !== menuItemId; });
5012
5032
  (_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger({
@@ -5027,7 +5047,7 @@ var VisualsRegister;
5027
5047
  /**
5028
5048
  * Returns an array of drilled visuals associated with this register.
5029
5049
  * The top array item is the first found.
5030
- * @param cursor
5050
+ * @param params
5031
5051
  * @returns
5032
5052
  */
5033
5053
  Register.prototype.GetRegosFromCursor = function (params) {
@@ -10412,8 +10432,7 @@ var MenuItemManager;
10412
10432
  /**
10413
10433
  * Disables a menu item by its id.
10414
10434
  * This will disable all children as well.
10415
- * @param id
10416
- * @param recursive
10435
+ * @param params
10417
10436
  */
10418
10437
  Manager.prototype.RemoveItemById = function (params) {
10419
10438
  var _a, _b;
@@ -12898,7 +12917,7 @@ function renderLegacyNavigator(iteration, params, bookmark, view) {
12898
12917
  function renderNavigator(iteration, params, bookmark, view) {
12899
12918
  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;
12900
12919
  return __awaiter(this, void 0, void 0, function () {
12901
- 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;
12920
+ 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;
12902
12921
  return __generator(this, function (_7) {
12903
12922
  switch (_7.label) {
12904
12923
  case 0:
@@ -13126,15 +13145,24 @@ function renderNavigator(iteration, params, bookmark, view) {
13126
13145
  entityIds: isolatedIds
13127
13146
  });
13128
13147
  }
13129
- params.manager.VisualsRegister.ClearLabelled();
13130
13148
  labelledIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.labelledEntityIds;
13131
13149
  if (labelledIds == null) {
13132
13150
  labelledIds = (_2 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _2 === void 0 ? void 0 : _2.labelledEntityIds;
13133
13151
  }
13134
- if (labelledIds != null) {
13152
+ if (!(labelledIds === null || labelledIds === void 0 ? void 0 : labelledIds.length)) {
13153
+ params.manager.VisualsRegister.ClearLabelled();
13154
+ }
13155
+ else {
13156
+ curLabelledIds = params.manager.VisualsRegister.GetLabelled();
13135
13157
  params.manager.VisualsRegister.SetLabelled({
13136
13158
  labelled: true,
13137
- entityIds: labelledIds
13159
+ entityIds: labelledIds,
13160
+ requestRender: false
13161
+ });
13162
+ toUnLabel = curLabelledIds.filter(function (id) { return labelledIds.indexOf(id) === -1; });
13163
+ params.manager.VisualsRegister.SetLabelled({
13164
+ labelled: false,
13165
+ entityIds: toUnLabel
13138
13166
  });
13139
13167
  }
13140
13168
  params.manager.VisualsRegister.ClearOpacity();
@@ -16133,7 +16161,7 @@ var ViewerUtils;
16133
16161
  ViewerUtils.CreateWidgets = CreateWidgets;
16134
16162
  })(ViewerUtils || (ViewerUtils = {}));
16135
16163
 
16136
- var VERSION$1 = "2.8.7";
16164
+ var VERSION$1 = "2.8.8";
16137
16165
 
16138
16166
  export { VERSION$1 as VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
16139
16167
  //# sourceMappingURL=bruce-cesium.es5.js.map