bruce-cesium 3.7.9 → 3.8.1

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, 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';
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, 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.
@@ -9932,16 +9932,19 @@ var EntitiesRenderManager;
9932
9932
  if (!(ids.length > 0)) return [3 /*break*/, 4];
9933
9933
  checkBatch = function () { return __awaiter(_this, void 0, void 0, function () {
9934
9934
  var entityIds, entities;
9935
- return __generator(this, function (_a) {
9936
- switch (_a.label) {
9935
+ var _a;
9936
+ return __generator(this, function (_b) {
9937
+ switch (_b.label) {
9937
9938
  case 0:
9938
9939
  entityIds = ids.splice(0, CHECK_BATCH_SIZE);
9939
9940
  return [4 /*yield*/, Entity$1.GetListByIds({
9940
9941
  api: api,
9941
- entityIds: entityIds
9942
+ entityIds: entityIds,
9943
+ historicKey: (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey,
9944
+ historicPoint: this.viewer.clock.currentTime.toString()
9942
9945
  })];
9943
9946
  case 1:
9944
- entities = (_a.sent()).entities;
9947
+ entities = (_b.sent()).entities;
9945
9948
  if (this.disposed) {
9946
9949
  return [2 /*return*/];
9947
9950
  }
@@ -13769,15 +13772,30 @@ var EntityFilterGetter;
13769
13772
  */
13770
13773
  Getter.prototype.viewerDateTimeSub = function () {
13771
13774
  var _this = this;
13772
- this.viewerDateTimeDispose();
13773
- if (!this.historicAttrKey) {
13775
+ if (!this.historicAttrKey || this.viewerDateTimeChangeRemoval) {
13774
13776
  return;
13775
13777
  }
13778
+ // This is multiplied by the speed of animation to figure
13779
+ // out how many animation "ticks" before we allow an update.
13780
+ var INTERVAL_WHILE_ANIMATING = 2.5 * 1000;
13781
+ var lastUpdateTime = null;
13776
13782
  var delayQueue = new DelayQueue(function () {
13777
- var current = _this.historicAttrDateTime;
13778
- _this.updateHistoricDateTime();
13779
- if (current != _this.historicAttrDateTime) {
13780
- _this.updateState();
13783
+ try {
13784
+ // If the timeline is animating then we'll wait longer to update.
13785
+ if (_this.viewer.clock.shouldAnimate && lastUpdateTime) {
13786
+ if (Math.abs(new Date().getTime() - lastUpdateTime) < INTERVAL_WHILE_ANIMATING) {
13787
+ return;
13788
+ }
13789
+ }
13790
+ lastUpdateTime = new Date().getTime();
13791
+ var current = _this.historicAttrDateTime;
13792
+ _this.updateHistoricDateTime();
13793
+ if (current != _this.historicAttrDateTime) {
13794
+ _this.updateState();
13795
+ }
13796
+ }
13797
+ catch (e) {
13798
+ console.error(e);
13781
13799
  }
13782
13800
  }, 250);
13783
13801
  var postUpdateRemoval = this.viewer.scene.postUpdate.addEventListener(function () {
@@ -13884,6 +13902,7 @@ var EntityFilterGetter;
13884
13902
  else {
13885
13903
  this.getterLoopId += 1;
13886
13904
  this.viewAreaDispose();
13905
+ this.viewerDateTimeDispose();
13887
13906
  }
13888
13907
  };
13889
13908
  Getter.prototype.postStatus = function (status) {
@@ -23500,7 +23519,7 @@ var ViewRenderEngine;
23500
23519
  ViewRenderEngine.Render = Render;
23501
23520
  })(ViewRenderEngine || (ViewRenderEngine = {}));
23502
23521
 
23503
- var VERSION = "3.7.9";
23522
+ var VERSION = "3.8.1";
23504
23523
 
23505
23524
  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 };
23506
23525
  //# sourceMappingURL=bruce-cesium.es5.js.map