bruce-cesium 2.2.8 → 2.3.0

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, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, DelayQueue, BatchedDataGetter, EntityRelationType, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, ProgramKey, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, Cartesian3, SceneMode, Math as Math$1, Cartesian2, CallbackProperty, Color, Rectangle, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, OrthographicFrustum, JulianDate, KmlDataSource, createOsmBuildings, EllipsoidGeodesic, EllipsoidTerrainProvider, sampleTerrainMostDetailed, defined, Cesium3DTileset, Model, Matrix4, Matrix3, IonResource, ScreenSpaceEventHandler, ScreenSpaceEventType, PolygonPipeline, CesiumInspector, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, ColorMaterialProperty, EasingFunction, GeometryInstance, Ion, BoundingSphere } from 'cesium';
3
+ import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, Entity, Primitive, Cesium3DTileFeature, HeightReference, DistanceDisplayCondition, NearFarScalar, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, Cesium3DTileColorBlendMode, KmlDataSource, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, OrthographicFrustum, JulianDate, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, Cesium3DTileset, Model, PolygonPipeline, ScreenSpaceEventHandler, ScreenSpaceEventType, Matrix4, Matrix3, IonResource, ColorMaterialProperty, EasingFunction, GeometryInstance, CesiumInspector, Ion, BoundingSphere } from 'cesium';
4
4
 
5
5
  var TIME_LAG = 300;
6
6
  var POSITION_CHECK_TIMER = 950;
@@ -1644,7 +1644,7 @@ function getValue(viewer, obj) {
1644
1644
  }
1645
1645
  function getStyle(api, entity, styleId) {
1646
1646
  return __awaiter(this, void 0, void 0, function () {
1647
- var style, type;
1647
+ var style, typeId, type;
1648
1648
  return __generator(this, function (_a) {
1649
1649
  switch (_a.label) {
1650
1650
  case 0:
@@ -1659,9 +1659,11 @@ function getStyle(api, entity, styleId) {
1659
1659
  _a.label = 2;
1660
1660
  case 2:
1661
1661
  if (!!style) return [3 /*break*/, 5];
1662
+ typeId = entity.Bruce["EntityType.ID"];
1663
+ if (!typeId) return [3 /*break*/, 5];
1662
1664
  return [4 /*yield*/, EntityType.Get({
1663
1665
  api: api,
1664
- entityTypeId: entity.Bruce["EntityType.ID"]
1666
+ entityTypeId: typeId
1665
1667
  })];
1666
1668
  case 3:
1667
1669
  type = (_a.sent()).entityType;
@@ -3579,13 +3581,25 @@ var EntitiesRenderManager;
3579
3581
  });
3580
3582
  Manager.prototype.Init = function (params) {
3581
3583
  var _this = this;
3582
- var _a, _b, _c, _d, _e, _f, _g;
3584
+ var _a, _b, _c, _d, _e, _f, _g, _h;
3583
3585
  if (this.disposed) {
3584
3586
  throw (new Error("This item is disposed."));
3585
3587
  }
3586
3588
  if (params === null || params === void 0 ? void 0 : params.item) {
3587
3589
  this.item = params.item;
3588
3590
  }
3591
+ if (!((_a = this.item.CameraZoomSettings) === null || _a === void 0 ? void 0 : _a.length)) {
3592
+ this.item.CameraZoomSettings = [
3593
+ {
3594
+ MinZoom: 0,
3595
+ MaxZoom: 100000,
3596
+ DisplayType: ZoomControl.EDisplayType.Model3D,
3597
+ LODCategoryID: "glb",
3598
+ LODLevel: 0,
3599
+ StyleID: 0
3600
+ }
3601
+ ];
3602
+ }
3589
3603
  var isTagItem = Boolean(this.item.BruceEntity.ExpandLayers);
3590
3604
  var tagsToRender = isTagItem ? this.item.BruceEntity.SelectedExpandLayers : null;
3591
3605
  if (!tagsToRender) {
@@ -3593,13 +3607,13 @@ var EntitiesRenderManager;
3593
3607
  }
3594
3608
  tagsToRender = [].concat(tagsToRender);
3595
3609
  var shouldRender = !isTagItem || tagsToRender.length > 0;
3596
- (_a = this.getter) === null || _a === void 0 ? void 0 : _a.ExcludeMenuItem(this.item.id);
3610
+ (_b = this.getter) === null || _b === void 0 ? void 0 : _b.ExcludeMenuItem(this.item.id);
3597
3611
  this.getter = null;
3598
- (_b = this.getterSub) === null || _b === void 0 ? void 0 : _b.call(this);
3612
+ (_c = this.getterSub) === null || _c === void 0 ? void 0 : _c.call(this);
3599
3613
  this.getterSub = null;
3600
- (_c = this.viewMonitorRemoval) === null || _c === void 0 ? void 0 : _c.call(this);
3614
+ (_d = this.viewMonitorRemoval) === null || _d === void 0 ? void 0 : _d.call(this);
3601
3615
  this.viewMonitorRemoval = null;
3602
- (_d = this.entityCheckQueue) === null || _d === void 0 ? void 0 : _d.Dispose();
3616
+ (_e = this.entityCheckQueue) === null || _e === void 0 ? void 0 : _e.Dispose();
3603
3617
  this.entityCheckQueue = null;
3604
3618
  clearInterval(this.renderQueueInterval);
3605
3619
  this.renderQueueInterval = null;
@@ -3611,13 +3625,13 @@ var EntitiesRenderManager;
3611
3625
  menuItemId: this.item.id,
3612
3626
  retainTagIds: tagsToRender
3613
3627
  });
3614
- (_e = this.clustering) === null || _e === void 0 ? void 0 : _e.Dispose();
3628
+ (_f = this.clustering) === null || _f === void 0 ? void 0 : _f.Dispose();
3615
3629
  }
3616
3630
  else {
3617
3631
  this.visualsManager.RemoveRegos({
3618
3632
  menuItemId: this.item.id
3619
3633
  });
3620
- (_f = this.clustering) === null || _f === void 0 ? void 0 : _f.Dispose();
3634
+ (_g = this.clustering) === null || _g === void 0 ? void 0 : _g.Dispose();
3621
3635
  return;
3622
3636
  }
3623
3637
  if (this.item.enableClustering) {
@@ -3626,7 +3640,7 @@ var EntitiesRenderManager;
3626
3640
  var api = this.apiGetter.getApi();
3627
3641
  this.getter = this.sharedGetters.GetOrCreateFilterGetter({
3628
3642
  api: api,
3629
- attrFilter: (_g = this.item.BruceEntity.Filter) !== null && _g !== void 0 ? _g : {},
3643
+ attrFilter: (_h = this.item.BruceEntity.Filter) !== null && _h !== void 0 ? _h : {},
3630
3644
  batchSize: BATCH_SIZE,
3631
3645
  typeId: this.item.BruceEntity["EntityType.ID"],
3632
3646
  monitor: this.monitor,
@@ -3936,9 +3950,22 @@ var EntitiesLoadedRenderManager;
3936
3950
  });
3937
3951
  Manager.prototype.Init = function () {
3938
3952
  var _this = this;
3953
+ var _a;
3939
3954
  if (this.disposed) {
3940
3955
  throw (new Error("This item is disposed."));
3941
3956
  }
3957
+ if (!((_a = this.item.CameraZoomSettings) === null || _a === void 0 ? void 0 : _a.length)) {
3958
+ this.item.CameraZoomSettings = [
3959
+ {
3960
+ MinZoom: 0,
3961
+ MaxZoom: 100000,
3962
+ DisplayType: ZoomControl.EDisplayType.Model3D,
3963
+ LODCategoryID: "glb",
3964
+ LODLevel: 0,
3965
+ StyleID: 0
3966
+ }
3967
+ ];
3968
+ }
3942
3969
  this.getter = new BatchedDataGetter.Getter(this.item.BruceEntity.Entities, this.monitor, BATCH_SIZE$1);
3943
3970
  this.getterSub = this.getter.OnUpdate.Subscribe(function (entities) {
3944
3971
  var _a;
@@ -5531,9 +5558,22 @@ var EntitiesIdsRenderManager;
5531
5558
  });
5532
5559
  Manager.prototype.Init = function () {
5533
5560
  var _this = this;
5561
+ var _a;
5534
5562
  if (this.disposed) {
5535
5563
  throw (new Error("This item is disposed."));
5536
5564
  }
5565
+ if (!((_a = this.item.CameraZoomSettings) === null || _a === void 0 ? void 0 : _a.length)) {
5566
+ this.item.CameraZoomSettings = [
5567
+ {
5568
+ MinZoom: 0,
5569
+ MaxZoom: 100000,
5570
+ DisplayType: ZoomControl.EDisplayType.Model3D,
5571
+ LODCategoryID: "glb",
5572
+ LODLevel: 0,
5573
+ StyleID: 0
5574
+ }
5575
+ ];
5576
+ }
5537
5577
  this.getter = new BatchedDataGetter.Getter(this.item.BruceEntity.EntityIds, this.monitor, BATCH_SIZE$2);
5538
5578
  this.getterSub = this.getter.OnUpdate.Subscribe(function (ids) {
5539
5579
  _this.onGetterUpdate(ids);
@@ -5719,9 +5759,22 @@ var EntityRenderManager;
5719
5759
  });
5720
5760
  Manager.prototype.Init = function () {
5721
5761
  var _this = this;
5762
+ var _a;
5722
5763
  if (this.disposed) {
5723
5764
  throw (new Error("This item is disposed."));
5724
5765
  }
5766
+ if (!((_a = this.item.CameraZoomSettings) === null || _a === void 0 ? void 0 : _a.length)) {
5767
+ this.item.CameraZoomSettings = [
5768
+ {
5769
+ MinZoom: 0,
5770
+ MaxZoom: 100000,
5771
+ DisplayType: ZoomControl.EDisplayType.Model3D,
5772
+ LODCategoryID: "glb",
5773
+ LODLevel: 0,
5774
+ StyleID: 0
5775
+ }
5776
+ ];
5777
+ }
5725
5778
  this.getter = new BatchedDataGetter.Getter([this.item.BruceEntity.EntityId], this.monitor, 1);
5726
5779
  this.getterSub = this.getter.OnUpdate.Subscribe(function (ids) {
5727
5780
  _this.onGetterUpdate(ids[0]);
@@ -8966,7 +9019,7 @@ var MenuItemCreator;
8966
9019
  case 1:
8967
9020
  if (!(i < menuItems.length)) return [3 /*break*/, 4];
8968
9021
  menuItem = menuItems[i];
8969
- return [4 /*yield*/, params.manager.RenderItem({
9022
+ return [4 /*yield*/, manager.RenderItem({
8970
9023
  apiGetter: apiGetter,
8971
9024
  item: menuItem
8972
9025
  })];
@@ -13311,7 +13364,7 @@ var WidgetSearchBar = /** @class */ (function (_super) {
13311
13364
  }
13312
13365
  var style = document.createElement("style");
13313
13366
  style.id = this.STYLESHEET_ID;
13314
- style.innerHTML = "\n .NextspaceSearchBar {\n position: absolute;\n z-index: 1;\n top: 10px;\n right: 10px;\n display: flex;\n box-sizing: border-box;\n box-shadow: 0 0 1px rgba(18,22,25,.24),0 18px 36px -4px rgba(18,22,25,.6);\n background: #21272a;\n border-radius: 9px;\n height: 48px;\n padding-left: 2px;\n padding-right: 2px;\n font-family: sans-serif;\n }\n\n .NextspaceSearchBar * {\n box-sizing: border-box;\n }\n\n .NextspaceSearchBar[is-opened=\"true\"] .NextspaceSearchBarContent {\n display: flex;\n overflow: visible;\n width: 260px;\n }\n\n .NextspaceSearchBarToggle {\n align-items: center;\n border-radius: 0;\n border-radius: 9px 0 0 9px;\n color: #fff;\n cursor: pointer;\n display: flex;\n flex-shrink: 0;\n font-size: 18px;\n height: 100%;\n justify-content: center;\n transition: .3s ease;\n width: 46px;\n }\n\n .NextspaceSearchBarToggle >svg {\n transition: .3s ease;\n }\n\n .NextspaceSearchBarToggle >svg:hover {\n -webkit-transform: scale(1.2);\n transform: scale(1.2);\n }\n\n .NextspaceSearchBarContent {\n flex-grow: 0;\n flex-shrink: 0;\n overflow: hidden;\n transition: .3s ease;\n width: 0;\n }\n\n .NextspaceSearchBarContent >input {\n background: transparent;\n border: none;\n color: #fff;\n font-size: 15px;\n height: 100%;\n outline: none;\n padding: 0 8px;\n width: 100%;\n }\n\n .NextspaceSearchBarResults {\n background-color: #21272a;\n border-radius: 0 0 6px 6px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n padding: 12px 8px 8px;\n position: absolute;\n top: calc(100% - 4px);\n width: 100%;\n left: 0;\n z-index: 1;\n }\n\n .NextspaceSearchBarResultsItem {\n align-items: center;\n color: #fff;\n cursor: pointer;\n display: flex;\n height: 30px;\n transition: .3s ease;\n font-size: 13px;\n }\n\n .NextspaceSearchBarResultsItem:hover .NextspaceSearchBarResultsItemIcon {\n -webkit-transform: scale(1.05);\n transform: scale(1.05);\n }\n\n .NextspaceSearchBarResultsItemIcon {\n align-items: center;\n display: flex;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n margin-right: 5px;\n width: 25px;\n }\n\n .NextspaceSearchBarResultsItemTip {\n flex-grow: 1;\n flex-shrink: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 50px;\n font-size: 15px;\n }\n\n .NextspaceSearchBarResultsWarning {\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n font-size: 15px;\n }\n ";
13367
+ style.innerHTML = "\n .NextspaceSearchBar {\n position: absolute;\n z-index: 1;\n top: 10px;\n right: 10px;\n display: flex;\n box-sizing: border-box;\n box-shadow: 0 0 1px rgba(18,22,25,.24),0 18px 36px -4px rgba(18,22,25,.6);\n background: #21272a;\n border-radius: 9px;\n height: 48px;\n padding-left: 2px;\n padding-right: 2px;\n font-family: sans-serif;\n }\n\n .NextspaceSearchBar * {\n box-sizing: border-box;\n }\n\n .NextspaceSearchBar[is-opened=\"true\"] .NextspaceSearchBarContent {\n display: flex;\n width: 260px;\n }\n\n .NextspaceSearchBarToggle {\n align-items: center;\n border-radius: 0;\n border-radius: 9px 0 0 9px;\n color: #fff;\n cursor: pointer;\n display: flex;\n flex-shrink: 0;\n font-size: 18px;\n height: 100%;\n justify-content: center;\n transition: .3s ease;\n width: 46px;\n }\n\n .NextspaceSearchBarToggle >svg {\n transition: .3s ease;\n }\n\n .NextspaceSearchBarToggle >svg:hover {\n -webkit-transform: scale(1.2);\n transform: scale(1.2);\n }\n\n .NextspaceSearchBarContent {\n flex-grow: 0;\n flex-shrink: 0;\n overflow: hidden;\n transition: .3s ease;\n width: 0;\n }\n\n .NextspaceSearchBarContent >input {\n background: transparent;\n border: none;\n color: #fff;\n font-size: 15px;\n height: 100%;\n outline: none;\n padding: 0 8px;\n width: 100%;\n }\n\n .NextspaceSearchBarResults {\n background-color: #21272a;\n border-radius: 0 0 6px 6px;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n padding: 12px 8px 8px;\n position: absolute;\n top: calc(100% - 4px);\n width: 100%;\n left: 0;\n z-index: 1;\n }\n\n .NextspaceSearchBarResultsItem {\n align-items: center;\n color: #fff;\n cursor: pointer;\n display: flex;\n height: 30px;\n transition: .3s ease;\n font-size: 13px;\n }\n\n .NextspaceSearchBarResultsItem:hover .NextspaceSearchBarResultsItemIcon {\n -webkit-transform: scale(1.05);\n transform: scale(1.05);\n }\n\n .NextspaceSearchBarResultsItemIcon {\n align-items: center;\n display: flex;\n flex-grow: 0;\n flex-shrink: 0;\n justify-content: center;\n margin-right: 5px;\n width: 25px;\n }\n\n .NextspaceSearchBarResultsItemTip {\n flex-grow: 1;\n flex-shrink: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 50px;\n font-size: 15px;\n }\n\n .NextspaceSearchBarResultsWarning {\n height: 30px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: white;\n font-size: 15px;\n }\n ";
13315
13368
  document.head.appendChild(style);
13316
13369
  };
13317
13370
  WidgetSearchBar.prototype._generateElement = function () {
@@ -14188,7 +14241,7 @@ var ViewerUtils;
14188
14241
  ViewerUtils.CreateWidgets = CreateWidgets;
14189
14242
  })(ViewerUtils || (ViewerUtils = {}));
14190
14243
 
14191
- var VERSION$1 = "2.2.8";
14244
+ var VERSION$1 = "2.2.9";
14192
14245
 
14193
14246
  export { VERSION$1 as VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
14194
14247
  //# sourceMappingURL=bruce-cesium.es5.js.map