bruce-cesium 6.0.9 → 6.1.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, Entity as Entity$1, ProjectViewTile, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttachment, EntityAttachmentType, EntityAttribute, AbstractApi, Session } 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, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, ColorBlendMode, HeadingPitchRoll, Transforms, Model, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, Cesium3DTileset, IonResource, EllipsoidGeodesic, EllipsoidTerrainProvider, sampleTerrainMostDetailed, defined, CesiumInspector, ClockRange, PolygonPipeline, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, IonResource, Cesium3DTileset, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -1269,16 +1269,21 @@ var CesiumAnimatedProperty;
1269
1269
  return;
1270
1270
  }
1271
1271
  let hasHeading = false;
1272
+ const indicesToUpdate = [];
1272
1273
  for (let i = 0; i < this.positions.length; i++) {
1273
- let pos = this.positions[i];
1274
+ const pos = this.positions[i];
1274
1275
  if (pos.heading !== null && pos.heading !== 0) {
1275
1276
  hasHeading = true;
1276
- break;
1277
+ return;
1278
+ }
1279
+ // Track positions that need updating while we're iterating.
1280
+ if (pos.heading !== null) {
1281
+ indicesToUpdate.push(i);
1277
1282
  }
1278
1283
  }
1279
1284
  if (!hasHeading) {
1280
- for (let i = 0; i < this.positions.length; i++) {
1281
- this.positions[i].heading = null;
1285
+ for (const index of indicesToUpdate) {
1286
+ this.positions[index].heading = null;
1282
1287
  }
1283
1288
  }
1284
1289
  }
@@ -1549,18 +1554,38 @@ var CesiumAnimatedProperty;
1549
1554
  if (!newSeries || newSeries.length === 0) {
1550
1555
  return;
1551
1556
  }
1557
+ const dateTimeIndexes = new Map();
1558
+ for (let i = 0; i < this.positions.length; i++) {
1559
+ const pos = this.positions[i];
1560
+ if (pos && pos.dateTime) {
1561
+ dateTimeIndexes.set(pos.dateTime.getTime(), i);
1562
+ }
1563
+ }
1552
1564
  for (const pos of newSeries) {
1553
1565
  if (!pos || !pos.pos3d || !pos.dateTime) {
1554
1566
  continue;
1555
1567
  }
1556
- const existingIndex = this.positions.findIndex(p => p.dateTime.getTime() === pos.dateTime.getTime());
1568
+ const existingIndex = dateTimeIndexes.get(pos.dateTime.getTime());
1557
1569
  if (existingIndex >= 0) {
1558
1570
  this.positions[existingIndex] = pos;
1559
1571
  }
1560
1572
  else {
1561
- this.AddPosition(pos);
1573
+ const newPoint = {
1574
+ pos: pos.pos3d.clone(),
1575
+ time: pos.dateTime.getTime(),
1576
+ realTime: Date.now()
1577
+ };
1578
+ this.positionHistory.push(newPoint);
1579
+ dateTimeIndexes.set(pos.dateTime.getTime(), this.positions.length);
1562
1580
  }
1563
1581
  }
1582
+ if (this.positionHistory.length > this.maxHistorySize) {
1583
+ this.positionHistory = this.positionHistory.slice(-this.maxHistorySize);
1584
+ }
1585
+ this.analyzeMovementPatterns();
1586
+ this.processHeadings();
1587
+ this.sortPositions();
1588
+ this.invalidateCache();
1564
1589
  }
1565
1590
  UpdatePositionForDateTime(pos3d, dateTime, heading) {
1566
1591
  if (!pos3d || !dateTime) {
@@ -15681,6 +15706,7 @@ var EntitiesIdsRenderManager;
15681
15706
  if (currentTick === prevTick) {
15682
15707
  return;
15683
15708
  }
15709
+ prevTick = currentTick;
15684
15710
  queue.Call();
15685
15711
  });
15686
15712
  this.viewerDateTimeChangeRemoval = () => {
@@ -33528,7 +33554,7 @@ class WidgetViewBar extends Widget.AWidget {
33528
33554
  }
33529
33555
  }
33530
33556
 
33531
- const VERSION = "6.0.9";
33557
+ const VERSION = "6.1.1";
33532
33558
 
33533
33559
  export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isOutlineChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, AssemblyRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
33534
33560
  //# sourceMappingURL=bruce-cesium.es5.js.map