bruce-cesium 4.9.4 → 4.9.5

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
- import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, AbstractApi, Session, EntityAttachment, EntityAttachmentType, EntityAttribute } from 'bruce-models';
1
+ import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, 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, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, HorizontalOrigin, VerticalOrigin, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, Matrix4, Matrix3, IonResource, Quaternion, 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, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -7637,7 +7637,7 @@ var EntityRenderEngine;
7637
7637
  }
7638
7638
  EntityRenderEngine.GetRenderGroupId = GetRenderGroupId;
7639
7639
  async function Render(params) {
7640
- var _a, _b, _c, _d, _e, _f, _g, _h;
7640
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
7641
7641
  const groupRenderParams = {
7642
7642
  apiGetter: params.apiGetter,
7643
7643
  viewer: params.viewer,
@@ -7735,8 +7735,9 @@ var EntityRenderEngine;
7735
7735
  // Update metadata for the same reason.
7736
7736
  existingRego.historicDateTime = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.HistoricDateTime;
7737
7737
  existingRego.historicAttrKey = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.HistoricAttrKey;
7738
+ existingRego.historicLayers = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.HistoricLayers;
7738
7739
  existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
7739
- existingRego.scenario = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.Scenario;
7740
+ existingRego.scenario = (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.Scenario;
7740
7741
  updated.set(id, true);
7741
7742
  }
7742
7743
  if (displayType == ZoomControl.EDisplayType.Model3D) {
@@ -7749,7 +7750,7 @@ var EntityRenderEngine;
7749
7750
  entity: entity,
7750
7751
  path: ["Bruce", "VectorGeometry"]
7751
7752
  });
7752
- if ((_g = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _g === void 0 ? void 0 : _g.length) {
7753
+ if ((_h = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _h === void 0 ? void 0 : _h.length) {
7753
7754
  multiGeometry.push(entity);
7754
7755
  }
7755
7756
  else {
@@ -7792,7 +7793,7 @@ var EntityRenderEngine;
7792
7793
  entity: entity,
7793
7794
  path: ["Bruce", "VectorGeometry"]
7794
7795
  });
7795
- if (!((_h = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _h === void 0 ? void 0 : _h.length)) {
7796
+ if (!((_j = geometry === null || geometry === void 0 ? void 0 : geometry.MultiGeometry) === null || _j === void 0 ? void 0 : _j.length)) {
7796
7797
  polygons.push(entity);
7797
7798
  continue;
7798
7799
  }
@@ -12050,7 +12051,7 @@ var EntitiesRenderManager;
12050
12051
  }, 3000);
12051
12052
  }
12052
12053
  setGetter() {
12053
- var _a, _b;
12054
+ var _a, _b, _c;
12054
12055
  this.unsetGetter();
12055
12056
  const isTagItem = Boolean(this.item.BruceEntity.ExpandLayers);
12056
12057
  let tagsToRender = isTagItem ? this.item.BruceEntity.SelectedExpandLayers : null;
@@ -12070,9 +12071,10 @@ var EntitiesRenderManager;
12070
12071
  tagIds: (tagsToRender === null || tagsToRender === void 0 ? void 0 : tagsToRender.length) ? tagsToRender : [],
12071
12072
  debugShowBounds: getShowDebugBounds(),
12072
12073
  cdn: this.item.cdnEnabled,
12074
+ historic: (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.historic,
12073
12075
  historicAttrKey: this.item.BruceEntity.historicAttrKey,
12074
12076
  historicInterpolation: this.item.historicInterpolation,
12075
- schemaId: (_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.schemaId,
12077
+ schemaId: (_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c.schemaId,
12076
12078
  scenario: this.scenario
12077
12079
  });
12078
12080
  const minMax = RenderManager.GetZoomMinMax({
@@ -12653,12 +12655,12 @@ var EntitiesRenderManager;
12653
12655
  * @returns
12654
12656
  */
12655
12657
  async renderAsIndividuals(entities, force = false) {
12656
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
12658
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
12657
12659
  // Entity ID -> historic records array.
12658
12660
  // We load this as extra information when rendering historic records.
12659
12661
  // This way we know what to animate towards as time changes.
12660
12662
  let entitiesHistoric = {};
12661
- if (((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey) && entities.length) {
12663
+ if ((((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historic) || ((_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b.historicAttrKey)) && entities.length) {
12662
12664
  // Interpolating.
12663
12665
  // We will allow non-historic Entities as long as they have historic data in the range.
12664
12666
  if (this.item.historicInterpolation) {
@@ -12684,14 +12686,14 @@ var EntitiesRenderManager;
12684
12686
  menuItemId: this.item.id,
12685
12687
  requestRender: false
12686
12688
  });
12687
- (_b = this.clustering) === null || _b === void 0 ? void 0 : _b.RemoveEntity(removeId, false);
12689
+ (_c = this.clustering) === null || _c === void 0 ? void 0 : _c.RemoveEntity(removeId, false);
12688
12690
  }
12689
12691
  entities = entities.filter(x => !toRemoveIds.includes(x.Bruce.ID));
12690
12692
  }
12691
12693
  // Not interpolating.
12692
12694
  // So we'll see if the Entities have a historic key or not.
12693
12695
  else {
12694
- const toRemoveIds = entities.filter(x => { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.HistoricAttrKey); }).map(x => x.Bruce.ID);
12696
+ const toRemoveIds = entities.filter(x => { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.HistoricLayers); }).map(x => x.Bruce.ID);
12695
12697
  for (let i = 0; i < toRemoveIds.length; i++) {
12696
12698
  const removeId = toRemoveIds[i];
12697
12699
  this.visualsManager.RemoveRegos({
@@ -12699,7 +12701,7 @@ var EntitiesRenderManager;
12699
12701
  menuItemId: this.item.id,
12700
12702
  requestRender: false
12701
12703
  });
12702
- (_c = this.clustering) === null || _c === void 0 ? void 0 : _c.RemoveEntity(removeId, false);
12704
+ (_d = this.clustering) === null || _d === void 0 ? void 0 : _d.RemoveEntity(removeId, false);
12703
12705
  }
12704
12706
  entities = entities.filter(x => !toRemoveIds.includes(x.Bruce.ID));
12705
12707
  }
@@ -12739,10 +12741,10 @@ var EntitiesRenderManager;
12739
12741
  const visual = rego === null || rego === void 0 ? void 0 : rego.visual;
12740
12742
  if (!visual || visual != cEntity) {
12741
12743
  const wasClustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
12742
- const tagIds = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d["Layer.ID"];
12744
+ const tagIds = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e["Layer.ID"];
12743
12745
  const rego = {
12744
12746
  entityId: id,
12745
- schemaId: (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.SchemaID,
12747
+ schemaId: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.SchemaID,
12746
12748
  menuItemId: this.item.id,
12747
12749
  menuItemType: this.item.Type,
12748
12750
  visual: cEntity,
@@ -12753,9 +12755,10 @@ var EntitiesRenderManager;
12753
12755
  overrideShow: wasClustered ? false : null,
12754
12756
  name: cEntity.name,
12755
12757
  cdn: this.item.cdnEnabled,
12756
- historicDateTime: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.HistoricDateTime,
12757
- historicAttrKey: (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.HistoricAttrKey,
12758
- scenario: (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.Scenario
12758
+ historicDateTime: (_g = entity.Bruce) === null || _g === void 0 ? void 0 : _g.HistoricDateTime,
12759
+ historicAttrKey: (_h = entity.Bruce) === null || _h === void 0 ? void 0 : _h.HistoricAttrKey,
12760
+ historicLayers: (_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j.HistoricLayers,
12761
+ scenario: (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.Scenario
12759
12762
  };
12760
12763
  this.visualsManager.AddRego({
12761
12764
  rego,
@@ -12766,12 +12769,13 @@ var EntitiesRenderManager;
12766
12769
  rego.name = cEntity.name;
12767
12770
  rego.visual = cEntity;
12768
12771
  rego.entityTypeId = entity.Bruce["EntityType.ID"];
12769
- rego.tagIds = ((_j = entity.Bruce) === null || _j === void 0 ? void 0 : _j["Layer.ID"]) ? [].concat(entity.Bruce["Layer.ID"]) : [];
12770
- rego.historicDateTime = (_k = entity.Bruce) === null || _k === void 0 ? void 0 : _k.HistoricDateTime;
12771
- rego.historicAttrKey = (_l = entity.Bruce) === null || _l === void 0 ? void 0 : _l.HistoricAttrKey;
12772
+ rego.tagIds = ((_l = entity.Bruce) === null || _l === void 0 ? void 0 : _l["Layer.ID"]) ? [].concat(entity.Bruce["Layer.ID"]) : [];
12773
+ rego.historicDateTime = (_m = entity.Bruce) === null || _m === void 0 ? void 0 : _m.HistoricDateTime;
12774
+ rego.historicAttrKey = (_o = entity.Bruce) === null || _o === void 0 ? void 0 : _o.HistoricAttrKey;
12775
+ rego.historicLayers = (_p = entity.Bruce) === null || _p === void 0 ? void 0 : _p.HistoricLayers;
12772
12776
  rego.cdn = this.item.cdnEnabled;
12773
- rego.schemaId = (_m = entity.Bruce) === null || _m === void 0 ? void 0 : _m.SchemaID;
12774
- rego.scenario = (_o = entity.Bruce) === null || _o === void 0 ? void 0 : _o.Scenario;
12777
+ rego.schemaId = (_q = entity.Bruce) === null || _q === void 0 ? void 0 : _q.SchemaID;
12778
+ rego.scenario = (_r = entity.Bruce) === null || _r === void 0 ? void 0 : _r.Scenario;
12775
12779
  // Marked as stale meaning some change was performed that requires a refresh.
12776
12780
  // This usually means a new sibling was added that we need to update.
12777
12781
  if (rego.stale) {
@@ -12801,7 +12805,7 @@ var EntitiesRenderManager;
12801
12805
  menuItemId: this.item.id,
12802
12806
  requestRender: false
12803
12807
  });
12804
- (_p = this.clustering) === null || _p === void 0 ? void 0 : _p.RemoveEntity(id, false);
12808
+ (_s = this.clustering) === null || _s === void 0 ? void 0 : _s.RemoveEntity(id, false);
12805
12809
  }
12806
12810
  }
12807
12811
  this.viewer.scene.requestRender();
@@ -16278,10 +16282,11 @@ var EntityFilterGetter;
16278
16282
  // We use this for refreshing historic data without having to repeat geographic queries.
16279
16283
  this.gatheredIntegrity = null;
16280
16284
  this.gatheredEntityIds = [];
16281
- const { api, viewer, viewPort, typeId, schemaId, batchSize, attrFilter, historicAttrKey, historicInterpolation, viaCdn, scenario } = params;
16285
+ const { api, viewer, viewPort, typeId, schemaId, batchSize, attrFilter, historicAttrKey, historicInterpolation, historic, viaCdn, scenario } = params;
16282
16286
  this.api = api;
16283
16287
  this.typeId = typeId;
16284
16288
  this.schemaId = schemaId;
16289
+ this.historic = Boolean(historic);
16285
16290
  this.historicAttrKey = historicAttrKey;
16286
16291
  this.historicInterpolation = Boolean(historicInterpolation);
16287
16292
  this.viaCdn = Boolean(viaCdn);
@@ -16299,6 +16304,9 @@ var EntityFilterGetter;
16299
16304
  */
16300
16305
  getIntegrityId() {
16301
16306
  let integrity = this.tagIds == null ? "" : this.tagIds.join();
16307
+ if (this.historic) {
16308
+ integrity += "isHistoric";
16309
+ }
16302
16310
  if (this.historicAttrKey) {
16303
16311
  integrity += this.historicAttrKey;
16304
16312
  }
@@ -16331,7 +16339,7 @@ var EntityFilterGetter;
16331
16339
  * If there is no historic attr set, this will do nothing.
16332
16340
  */
16333
16341
  viewerDateTimeSub() {
16334
- if (!this.historicAttrKey || this.viewerDateTimeChangeRemoval) {
16342
+ if ((!this.historicAttrKey && !this.historic) || this.viewerDateTimeChangeRemoval) {
16335
16343
  return;
16336
16344
  }
16337
16345
  // This is multiplied by the speed of animation to figure
@@ -16374,7 +16382,7 @@ var EntityFilterGetter;
16374
16382
  };
16375
16383
  }
16376
16384
  updateHistoricDateTime() {
16377
- if (!this.historicAttrKey) {
16385
+ if (!this.historicAttrKey && !this.historic) {
16378
16386
  this.historicAttrDateTime = null;
16379
16387
  return;
16380
16388
  }
@@ -16555,7 +16563,7 @@ var EntityFilterGetter;
16555
16563
  api: this.api,
16556
16564
  scenario: this.scenario,
16557
16565
  historicKey: this.historicAttrKey,
16558
- historicPoint: this.historicAttrDateTime,
16566
+ historicPoint: (this.historicAttrKey || this.historic) ? this.historicAttrDateTime : null,
16559
16567
  schemaId: this.schemaId,
16560
16568
  filter: {
16561
16569
  pageSize: PAGE_SIZE,
@@ -16771,6 +16779,7 @@ function createFilterGetterCacheKey(params) {
16771
16779
  cacheKey += params.schemaId ? params.schemaId : "";
16772
16780
  cacheKey += JSON.stringify(params.tagIds ? params.tagIds : []);
16773
16781
  cacheKey += params.historicAttrKey ? params.historicAttrKey : "";
16782
+ cacheKey += params.historic ? "true" : "false";
16774
16783
  cacheKey += params.scenario ? params.scenario : 0;
16775
16784
  if (params.historicAttrKey) {
16776
16785
  cacheKey += params.historicInterpolation ? "true" : "false";
@@ -16798,6 +16807,7 @@ var SharedGetters;
16798
16807
  schemaId: params.schemaId,
16799
16808
  batchSize: params.batchSize,
16800
16809
  attrFilter: params.attrFilter,
16810
+ historic: params.historic,
16801
16811
  historicAttrKey: params.historicAttrKey,
16802
16812
  historicInterpolation: params.historicInterpolation,
16803
16813
  viaCdn: params.cdn,
@@ -28347,7 +28357,7 @@ class WidgetViewBar extends Widget.AWidget {
28347
28357
  }
28348
28358
  }
28349
28359
 
28350
- const VERSION = "4.9.4";
28360
+ const VERSION = "4.9.5";
28351
28361
 
28352
28362
  export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, 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 };
28353
28363
  //# sourceMappingURL=bruce-cesium.es5.js.map