bruce-cesium 5.2.1 → 5.2.2

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, 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, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, EllipsoidTerrainProvider, sampleTerrainMostDetailed, defined, PolygonPipeline, CesiumInspector, ClockRange, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } 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, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, Quaternion, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -12183,7 +12183,7 @@ var EntitiesRenderManager;
12183
12183
  const minMax = RenderManager.GetZoomMinMax({
12184
12184
  zoomControl: this.zoomControl
12185
12185
  });
12186
- this.getter.IncludeMenuItem(this.item.id, (tagsToRender === null || tagsToRender === void 0 ? void 0 : tagsToRender.length) ? tagsToRender : [], minMax[0], minMax[1]);
12186
+ this.getter.IncludeMenuItem(this.item.id, this.item.BruceEntity["EntityType.ID"], (tagsToRender === null || tagsToRender === void 0 ? void 0 : tagsToRender.length) ? tagsToRender : [], minMax[0], minMax[1]);
12187
12187
  this.getterSub = this.getter.OnUpdate.Subscribe((entities) => {
12188
12188
  if (isTagItem) {
12189
12189
  this.distributeForRender(entities.filter((entity) => {
@@ -14633,7 +14633,8 @@ const MAX_RETRY_ATTEMPTS = 1;
14633
14633
  const RETRY_DELAY_INCREMENT = 500;
14634
14634
  const REQUEST_PAGE_DELAY = 50;
14635
14635
  class regMenuItemGetter {
14636
- constructor(tagIds, minHeight, maxHeight) {
14636
+ constructor(typeId, tagIds, minHeight, maxHeight) {
14637
+ this.TypeId = typeId;
14637
14638
  this.TagIds = tagIds;
14638
14639
  this.MinHeight = minHeight;
14639
14640
  this.MaxHeight = maxHeight;
@@ -14700,9 +14701,9 @@ var EntityFilterGetter;
14700
14701
  // We use this for refreshing historic data without having to repeat geographic queries.
14701
14702
  this.gatheredIntegrity = null;
14702
14703
  this.gatheredEntityIds = [];
14703
- const { api, viewer, viewPort, typeId, schemaId, batchSize, attrFilter, historicAttrKey, historicInterpolation, historic, viaCdn, scenario } = params;
14704
+ const { api, viewer, viewPort, typeIds, schemaId, batchSize, attrFilter, historicAttrKey, historicInterpolation, historic, viaCdn, scenario } = params;
14704
14705
  this.api = api;
14705
- this.typeId = typeId;
14706
+ this.typeIds = typeIds;
14706
14707
  this.schemaId = schemaId;
14707
14708
  this.historic = Boolean(historic);
14708
14709
  this.historicAttrKey = historicAttrKey;
@@ -14732,6 +14733,9 @@ var EntityFilterGetter;
14732
14733
  if (this.scenario) {
14733
14734
  integrity += this.scenario;
14734
14735
  }
14736
+ if (this.typeIds) {
14737
+ integrity += this.typeIds.join();
14738
+ }
14735
14739
  return integrity;
14736
14740
  }
14737
14741
  viewAreaSub() {
@@ -14829,8 +14833,8 @@ var EntityFilterGetter;
14829
14833
  GetMenuItems() {
14830
14834
  return Object.keys(this.registeredItems);
14831
14835
  }
14832
- IncludeMenuItem(menuItemId, layerIds, minHeight, maxHeight) {
14833
- this.registeredItems[menuItemId] = new regMenuItemGetter(layerIds, minHeight, maxHeight);
14836
+ IncludeMenuItem(menuItemId, typeId, layerIds, minHeight, maxHeight) {
14837
+ this.registeredItems[menuItemId] = new regMenuItemGetter(typeId, layerIds, minHeight, maxHeight);
14834
14838
  this.updateState();
14835
14839
  }
14836
14840
  ExcludeMenuItem(menuItemId) {
@@ -14854,6 +14858,7 @@ var EntityFilterGetter;
14854
14858
  }
14855
14859
  updateState() {
14856
14860
  const tagIds = [];
14861
+ const typeIds = [];
14857
14862
  const menuItemIds = this.GetMenuItems();
14858
14863
  let minHeight = null;
14859
14864
  let maxHeight = null;
@@ -14875,12 +14880,19 @@ var EntityFilterGetter;
14875
14880
  }
14876
14881
  }
14877
14882
  }
14883
+ const itemTypeId = menuItem.TypeId;
14884
+ if (itemTypeId) {
14885
+ if (!typeIds.includes(itemTypeId)) {
14886
+ typeIds.push(itemTypeId);
14887
+ }
14888
+ }
14878
14889
  }
14879
14890
  }
14880
14891
  if (menuItemIds.length > 0) {
14881
14892
  // Reset cells so none are marked as fetched.
14882
14893
  this.cells = new EntityGlobe.Grid();
14883
14894
  this.tagIds = tagIds;
14895
+ this.typeIds = typeIds;
14884
14896
  this.minHeight = minHeight;
14885
14897
  this.maxHeight = maxHeight;
14886
14898
  this.updateBounds();
@@ -14977,7 +14989,7 @@ var EntityFilterGetter;
14977
14989
  nextPage: false,
14978
14990
  nextPageUrl: null
14979
14991
  };
14980
- await SharedGetters.Queue.Run("Loading Entities from Menu Item that loads Entity Type: " + this.typeId, async () => {
14992
+ await SharedGetters.Queue.Run("Loading Entities from Menu Item that loads Entity Type: " + this.typeIds, async () => {
14981
14993
  var _a;
14982
14994
  if (abortController.signal.aborted || !((_a = this.GetMenuItems()) === null || _a === void 0 ? void 0 : _a.length)) {
14983
14995
  return;
@@ -15005,7 +15017,7 @@ var EntityFilterGetter;
15005
15017
  filter: {
15006
15018
  pageSize: PAGE_SIZE,
15007
15019
  pageIndex: curCell.FetchPageIndex,
15008
- entityTypeId: this.typeId,
15020
+ entityTypeId: this.typeIds,
15009
15021
  layerIds: this.tagIds,
15010
15022
  // Any tag specified will be allowed.
15011
15023
  layerIdsOperator: "in",
@@ -15150,7 +15162,7 @@ var EntityFilterGetter;
15150
15162
  // Controller we can use to abort the request when a new loop starts.
15151
15163
  const controller = this.historicRefreshAbortController = new AbortController();
15152
15164
  let entities = [];
15153
- await SharedGetters.Queue.Run("Refreshing historic data in Menu Item that loads Entity Type: " + this.typeId, async () => {
15165
+ await SharedGetters.Queue.Run("Refreshing historic data in Menu Item that loads Entity Type: " + this.typeIds, async () => {
15154
15166
  var _a;
15155
15167
  if (controller.signal.aborted || !((_a = this.GetMenuItems()) === null || _a === void 0 ? void 0 : _a.length)) {
15156
15168
  return;
@@ -15164,7 +15176,7 @@ var EntityFilterGetter;
15164
15176
  filter: {
15165
15177
  pageSize: batch.length,
15166
15178
  pageIndex: 0,
15167
- entityTypeId: this.typeId,
15179
+ entityTypeId: this.typeIds,
15168
15180
  layerIds: this.tagIds,
15169
15181
  layerIdsOperator: "in",
15170
15182
  sortOrder: Api.ESortOrder.Asc,
@@ -15220,7 +15232,9 @@ var EntityFilterGetter;
15220
15232
  function createFilterGetterCacheKey(params) {
15221
15233
  let cacheKey = "";
15222
15234
  cacheKey += params.api.GetBaseUrl();
15223
- cacheKey += params.typeId;
15235
+ // Not including Type ID in the cache key now.
15236
+ // This allows us to re-use the same getter between Entity Types.
15237
+ // cacheKey += params.typeId;
15224
15238
  cacheKey += params.batchSize;
15225
15239
  cacheKey += String(params.cdn);
15226
15240
  cacheKey += params.schemaId ? params.schemaId : "";
@@ -15250,7 +15264,7 @@ var SharedGetters;
15250
15264
  api: params.api,
15251
15265
  viewer: params.viewer,
15252
15266
  viewPort: params.monitor,
15253
- typeId: params.typeId,
15267
+ typeIds: !params.typeId ? null : typeof params.typeId == "string" ? [params.typeId] : params.typeId,
15254
15268
  schemaId: params.schemaId,
15255
15269
  batchSize: params.batchSize,
15256
15270
  attrFilter: params.attrFilter,
@@ -29909,7 +29923,7 @@ class WidgetViewBar extends Widget.AWidget {
29909
29923
  }
29910
29924
  }
29911
29925
 
29912
- const VERSION = "5.2.1";
29926
+ const VERSION = "5.2.2";
29913
29927
 
29914
29928
  export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isHistoricMetadataChanged, 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, 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 };
29915
29929
  //# sourceMappingURL=bruce-cesium.es5.js.map