bruce-cesium 3.7.7 → 3.7.9

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, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, CzmlDataSource, Quaternion, Intersect } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, NearFarScalar, Model, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, GeoJsonDataSource, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, OrthographicFrustum, EasingFunction, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Quaternion, Intersect } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9828,10 +9828,11 @@ var EntitiesRenderManager;
9828
9828
  this.sources = [];
9829
9829
  };
9830
9830
  Manager.prototype.ReRender = function (params) {
9831
+ var _a;
9831
9832
  return __awaiter(this, void 0, void 0, function () {
9832
9833
  var entityIds, force, entities, data, e_1;
9833
- return __generator(this, function (_a) {
9834
- switch (_a.label) {
9834
+ return __generator(this, function (_b) {
9835
+ switch (_b.label) {
9835
9836
  case 0:
9836
9837
  entityIds = params.entityIds, force = params.force, entities = params.entities;
9837
9838
  if (entities && !entityIds) {
@@ -9852,17 +9853,19 @@ var EntitiesRenderManager;
9852
9853
  this.renderEntities(entities, true);
9853
9854
  return [3 /*break*/, 4];
9854
9855
  case 1:
9855
- _a.trys.push([1, 3, , 4]);
9856
+ _b.trys.push([1, 3, , 4]);
9856
9857
  return [4 /*yield*/, Entity$1.GetListByIds({
9857
9858
  api: this.apiGetter.getApi(),
9858
- entityIds: entityIds
9859
+ entityIds: entityIds,
9860
+ historicKey: (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey,
9861
+ historicPoint: this.viewer.clock.currentTime.toString()
9859
9862
  })];
9860
9863
  case 2:
9861
- data = _a.sent();
9864
+ data = _b.sent();
9862
9865
  this.renderEntities(data.entities, true);
9863
9866
  return [3 /*break*/, 4];
9864
9867
  case 3:
9865
- e_1 = _a.sent();
9868
+ e_1 = _b.sent();
9866
9869
  console.error(e_1);
9867
9870
  return [3 /*break*/, 4];
9868
9871
  case 4: return [3 /*break*/, 8];
@@ -9872,8 +9875,8 @@ var EntitiesRenderManager;
9872
9875
  return [3 /*break*/, 8];
9873
9876
  case 6: return [4 /*yield*/, this.doEntityCheck(entityIds)];
9874
9877
  case 7:
9875
- _a.sent();
9876
- _a.label = 8;
9878
+ _b.sent();
9879
+ _b.label = 8;
9877
9880
  case 8: return [2 /*return*/];
9878
9881
  }
9879
9882
  });
@@ -10334,12 +10337,12 @@ var EntitiesRenderManager;
10334
10337
  * @returns
10335
10338
  */
10336
10339
  Manager.prototype.renderAsIndividuals = function (entities, force) {
10337
- var _a, _b, _c, _d, _e, _f;
10340
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
10338
10341
  if (force === void 0) { force = false; }
10339
10342
  return __awaiter(this, void 0, void 0, function () {
10340
- var toRemove, i, entity, _g, updated, cEntities, i, entity, id, cEntity, rego, visual, wasClustered, tagIds, rego_1;
10341
- return __generator(this, function (_h) {
10342
- switch (_h.label) {
10343
+ var toRemove, i, entity, _k, updated, cEntities, i, entity, id, cEntity, rego, visual, wasClustered, tagIds, rego_1;
10344
+ return __generator(this, function (_l) {
10345
+ switch (_l.label) {
10343
10346
  case 0:
10344
10347
  if ((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey) {
10345
10348
  toRemove = entities.filter(function (x) { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.historicAttrKey); });
@@ -10364,7 +10367,7 @@ var EntitiesRenderManager;
10364
10367
  force: force
10365
10368
  })];
10366
10369
  case 1:
10367
- _g = _h.sent(), updated = _g.updated, cEntities = _g.entities;
10370
+ _k = _l.sent(), updated = _k.updated, cEntities = _k.entities;
10368
10371
  if (this.disposed) {
10369
10372
  this.doDispose();
10370
10373
  return [2 /*return*/];
@@ -10402,7 +10405,14 @@ var EntitiesRenderManager;
10402
10405
  requestRender: false
10403
10406
  });
10404
10407
  }
10405
- else if (updated.get(id)) {
10408
+ else if (updated.get(id) && rego) {
10409
+ rego.name = cEntity.name;
10410
+ rego.visual = cEntity;
10411
+ rego.entityTypeId = entity.Bruce["EntityType.ID"];
10412
+ rego.tagIds = ((_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f["Layer.ID"]) ? [].concat(entity.Bruce["Layer.ID"]) : [];
10413
+ rego.historicDateTime = (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.historicDateTime;
10414
+ rego.historicAttrKey = (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.historicAttrKey;
10415
+ rego.cdn = this.item.cdnEnabled;
10406
10416
  // We manually trigger an update event since the graphic was updated but not recreated.
10407
10417
  this.visualsManager.OnUpdate.Trigger({
10408
10418
  type: VisualsRegister.EVisualUpdateType.Update,
@@ -10417,7 +10427,7 @@ var EntitiesRenderManager;
10417
10427
  menuItemId: this.item.id,
10418
10428
  requestRender: false
10419
10429
  });
10420
- (_f = this.clustering) === null || _f === void 0 ? void 0 : _f.RemoveEntity(id, false);
10430
+ (_j = this.clustering) === null || _j === void 0 ? void 0 : _j.RemoveEntity(id, false);
10421
10431
  }
10422
10432
  }
10423
10433
  this.viewer.scene.requestRender();
@@ -11228,7 +11238,10 @@ var EntitiesLoadedRenderManager;
11228
11238
  requestRender: false
11229
11239
  });
11230
11240
  }
11231
- else if (updated.get(id)) {
11241
+ else if (updated.get(id) && rego) {
11242
+ rego.visual = cEntity;
11243
+ rego.entityTypeId = entity.Bruce["EntityType.ID"];
11244
+ rego.name = cEntity.name;
11232
11245
  // We manually trigger an update event since the graphic was updated but not recreated.
11233
11246
  this.visualsManager.OnUpdate.Trigger({
11234
11247
  type: VisualsRegister.EVisualUpdateType.Update,
@@ -11837,7 +11850,10 @@ var EntitiesIdsRenderManager;
11837
11850
  requestRender: false
11838
11851
  });
11839
11852
  }
11840
- else if (updated.get(id)) {
11853
+ else if (updated.get(id) && rego) {
11854
+ rego.visual = cEntity;
11855
+ rego.entityTypeId = entity.Bruce["EntityType.ID"];
11856
+ rego.name = cEntity.name;
11841
11857
  // We manually trigger an update event since the graphic was updated but not recreated.
11842
11858
  this.visualsManager.OnUpdate.Trigger({
11843
11859
  type: VisualsRegister.EVisualUpdateType.Update,
@@ -12051,7 +12067,10 @@ var EntityRenderManager;
12051
12067
  requestRender: false
12052
12068
  });
12053
12069
  }
12054
- else if (updated.get(id)) {
12070
+ else if (updated.get(id) && rego) {
12071
+ rego.visual = cEntity;
12072
+ rego.entityTypeId = entity.Bruce["EntityType.ID"];
12073
+ rego.name = cEntity.name;
12055
12074
  // We manually trigger an update event since the graphic was updated but not recreated.
12056
12075
  this.visualsManager.OnUpdate.Trigger({
12057
12076
  type: VisualsRegister.EVisualUpdateType.Update,
@@ -13728,9 +13747,6 @@ var EntityFilterGetter;
13728
13747
  var integrity = this.tagIds == null ? "" : this.tagIds.join();
13729
13748
  if (this.historicAttrKey) {
13730
13749
  integrity += this.historicAttrKey;
13731
- if (this.historicAttrDateTime) {
13732
- integrity += this.historicAttrDateTime;
13733
- }
13734
13750
  }
13735
13751
  return integrity;
13736
13752
  };
@@ -13758,9 +13774,9 @@ var EntityFilterGetter;
13758
13774
  return;
13759
13775
  }
13760
13776
  var delayQueue = new DelayQueue(function () {
13761
- var current = _this.getIntegrityId();
13777
+ var current = _this.historicAttrDateTime;
13762
13778
  _this.updateHistoricDateTime();
13763
- if (current != _this.getIntegrityId()) {
13779
+ if (current != _this.historicAttrDateTime) {
13764
13780
  _this.updateState();
13765
13781
  }
13766
13782
  }, 250);
@@ -13779,8 +13795,6 @@ var EntityFilterGetter;
13779
13795
  Getter.prototype.updateHistoricDateTime = function () {
13780
13796
  if (!this.historicAttrKey) {
13781
13797
  this.historicAttrDateTime = null;
13782
- this.historicAttrDateTimeMin = null;
13783
- this.historicAttrDateTimeMax = null;
13784
13798
  return;
13785
13799
  }
13786
13800
  var isChanged = function (before, after) {
@@ -13795,16 +13809,8 @@ var EntityFilterGetter;
13795
13809
  };
13796
13810
  var oldDateTime = this.historicAttrDateTime ? new Date(this.historicAttrDateTime) : null;
13797
13811
  var newDateTime = JulianDate.toDate(this.viewer.clock.currentTime);
13798
- var oldDateMin = this.historicAttrDateTimeMin ? new Date(this.historicAttrDateTimeMin) : null;
13799
- var newDateMin = this.viewer.clock.startTime ? JulianDate.toDate(this.viewer.clock.startTime) : null;
13800
- var oldDateMax = this.historicAttrDateTimeMax ? new Date(this.historicAttrDateTimeMax) : null;
13801
- var newDateMax = this.viewer.clock.stopTime ? JulianDate.toDate(this.viewer.clock.stopTime) : null;
13802
- if (isChanged(oldDateTime, newDateTime) ||
13803
- isChanged(oldDateMin, newDateMin) ||
13804
- isChanged(oldDateMax, newDateMax)) {
13812
+ if (isChanged(oldDateTime, newDateTime)) {
13805
13813
  this.historicAttrDateTime = newDateTime.toISOString();
13806
- this.historicAttrDateTimeMin = newDateMin === null || newDateMin === void 0 ? void 0 : newDateMin.toISOString();
13807
- this.historicAttrDateTimeMax = newDateMax === null || newDateMax === void 0 ? void 0 : newDateMax.toISOString();
13808
13814
  }
13809
13815
  };
13810
13816
  Getter.prototype.viewerDateTimeDispose = function () {
@@ -13971,8 +13977,6 @@ var EntityFilterGetter;
13971
13977
  api: this.api,
13972
13978
  historicKey: this.historicAttrKey,
13973
13979
  historicPoint: this.historicAttrDateTime,
13974
- historicFrom: this.historicAttrKey ? this.historicAttrDateTimeMin : null,
13975
- historicTo: this.historicAttrKey ? this.historicAttrDateTimeMax : null,
13976
13980
  filter: {
13977
13981
  pageSize: PAGE_SIZE,
13978
13982
  pageIndex: curCell.FetchPageIndex,
@@ -23496,7 +23500,7 @@ var ViewRenderEngine;
23496
23500
  ViewRenderEngine.Render = Render;
23497
23501
  })(ViewRenderEngine || (ViewRenderEngine = {}));
23498
23502
 
23499
- var VERSION = "3.7.7";
23503
+ var VERSION = "3.7.9";
23500
23504
 
23501
23505
  export { 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, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, Draw3dPolygon, Draw3dPolyline };
23502
23506
  //# sourceMappingURL=bruce-cesium.es5.js.map