bruce-cesium 3.8.3 → 3.8.4

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, EntityHistoricData, 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, SceneMode, GeoJsonDataSource, ColorMaterialProperty, ConstantProperty, Cesium3DTileColorBlendMode, HeadingPitchRange, Entity, Primitive, Cesium3DTileFeature, DistanceDisplayCondition, NearFarScalar, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorBlendMode, HeadingPitchRoll, Transforms, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, EllipsoidTerrainProvider, CesiumInspector, OrthographicFrustum, defined, ClockRange, EasingFunction, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, PolygonPipeline, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, ScreenSpaceEventHandler, ScreenSpaceEventType, Matrix4, Matrix3, IonResource, BoundingSphere, GeometryInstance, 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, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, CzmlDataSource, Quaternion, Intersect } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1272,6 +1272,8 @@ var CesiumAnimatedProperty;
1272
1272
  */
1273
1273
  var AnimatePositionSeries = /** @class */ (function () {
1274
1274
  function AnimatePositionSeries(params) {
1275
+ this.cachedCalc = null;
1276
+ this.cachedTime = null;
1275
1277
  this.viewer = params.viewer;
1276
1278
  this.positions = params.posses;
1277
1279
  // Order positions by date.
@@ -1280,38 +1282,47 @@ var CesiumAnimatedProperty;
1280
1282
  });
1281
1283
  }
1282
1284
  AnimatePositionSeries.prototype.GetValue = function () {
1285
+ var _this = this;
1283
1286
  var now = this.viewer.scene.lastRenderTime;
1284
1287
  if (!now) {
1285
1288
  now = this.viewer.clock.currentTime;
1286
1289
  }
1287
1290
  var nowTime = JulianDate.toDate(now);
1288
- // See if we're before the first position.
1289
- if (nowTime.getTime() <= this.positions[0].dateTime.getTime()) {
1290
- return this.positions[0].pos3d;
1291
- }
1292
- // See if we're after the last position.
1293
- if (nowTime.getTime() >= this.positions[this.positions.length - 1].dateTime.getTime()) {
1294
- return this.positions[this.positions.length - 1].pos3d;
1291
+ if (this.cachedTime == nowTime.getTime()) {
1292
+ return this.cachedCalc;
1295
1293
  }
1296
- // Find the current position.
1297
- var lastIndex = 0;
1298
- for (var i = 1; i < this.positions.length; i++) {
1299
- var pos = this.positions[i];
1300
- if (nowTime.getTime() >= pos.dateTime.getTime()) {
1301
- lastIndex = i;
1294
+ var calculate = function () {
1295
+ // See if we're before the first position.
1296
+ if (nowTime.getTime() <= _this.positions[0].dateTime.getTime()) {
1297
+ return _this.positions[0].pos3d;
1302
1298
  }
1303
- else {
1304
- break;
1299
+ // See if we're after the last position.
1300
+ if (nowTime.getTime() >= _this.positions[_this.positions.length - 1].dateTime.getTime()) {
1301
+ return _this.positions[_this.positions.length - 1].pos3d;
1305
1302
  }
1306
- }
1307
- var last = this.positions[lastIndex];
1308
- // Interpolate the position.
1309
- var next = this.positions[lastIndex + 1];
1310
- if (!next) {
1311
- return last.pos3d;
1312
- }
1313
- var progress = (nowTime.getTime() - last.dateTime.getTime()) / (next.dateTime.getTime() - last.dateTime.getTime());
1314
- return Cartesian3.lerp(last.pos3d, next.pos3d, progress, new Cartesian3());
1303
+ // Find the current position.
1304
+ var lastIndex = 0;
1305
+ for (var i = 1; i < _this.positions.length; i++) {
1306
+ var pos = _this.positions[i];
1307
+ if (nowTime.getTime() >= pos.dateTime.getTime()) {
1308
+ lastIndex = i;
1309
+ }
1310
+ else {
1311
+ break;
1312
+ }
1313
+ }
1314
+ var last = _this.positions[lastIndex];
1315
+ // Interpolate the position.
1316
+ var next = _this.positions[lastIndex + 1];
1317
+ if (!next) {
1318
+ return last.pos3d;
1319
+ }
1320
+ var progress = (nowTime.getTime() - last.dateTime.getTime()) / (next.dateTime.getTime() - last.dateTime.getTime());
1321
+ return Cartesian3.lerp(last.pos3d, next.pos3d, progress, new Cartesian3());
1322
+ };
1323
+ this.cachedTime = nowTime.getTime();
1324
+ this.cachedCalc = calculate();
1325
+ return this.cachedCalc;
1315
1326
  };
1316
1327
  return AnimatePositionSeries;
1317
1328
  }());
@@ -24077,7 +24088,7 @@ var ViewRenderEngine;
24077
24088
  ViewRenderEngine.Render = Render;
24078
24089
  })(ViewRenderEngine || (ViewRenderEngine = {}));
24079
24090
 
24080
- var VERSION = "3.8.3";
24091
+ var VERSION = "3.8.4";
24081
24092
 
24082
24093
  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 };
24083
24094
  //# sourceMappingURL=bruce-cesium.es5.js.map