bruce-cesium 4.7.3 → 4.7.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, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttribute, EntityAttachment, EntityAttachmentType, AbstractApi, Session } 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, EntityAttribute, EntityAttachment, EntityAttachmentType, 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, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, GeoJsonDataSource, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, PolygonPipeline, CesiumInspector, defined, ClockRange, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, BoundingSphere, GeometryInstance, Quaternion, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, 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, SceneMode, GeoJsonDataSource, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, CesiumInspector, defined, ClockRange, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, PolygonPipeline, Matrix4, Matrix3, IonResource, BoundingSphere, GeometryInstance, Quaternion, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4229,7 +4229,7 @@ var EntityRenderEnginePoint;
4229
4229
  function Render(params) {
4230
4230
  var _a, _b, _c, _d;
4231
4231
  return __awaiter(this, void 0, void 0, function () {
4232
- var entity, style, type, cEntity, siblings, heightRef, animatePosition, shouldShowTrack, prepareExistingGraphic, updateShouldShowTrack, iconUrlRows, icon, iconUrl, metadata, api, image, e_1, iconScale, disableDepthTest, bColor, cColor, animateColorIn_1, position, series, currentImgKey, series, pos3d, prevPos3d, radius, bFill, cFill, outline, cOutline, outlineWidth, bOutline, pos3d, extrusion, hasOutline, outlineExtrusion, outlineEntity, bColor, cColor, size, circleBillboard, disableDepthTest, animateColorIn_2, position, series, imgKey, currentImgKey, series, pos3d, prevPos3d, lStyle, bColor, cColor, width, lHeightRef, trackEntity;
4232
+ var entity, style, type, cEntity, siblings, heightRef, animatePosition, shouldShowTrack, prepareExistingGraphic, updateShouldShowTrack, iconUrlRows, icon, iconUrl, metadata, api, image, e_1, iconScale, disableDepthTest, bColor, cColor, animateColorIn_1, position, series, currentImgKey, series, pos3d, prevPos3d, radius, bFill, cFill, outline, cOutline, outlineWidth, bOutline, pos3d, extrusion, hasOutline, classification, outlineExtrusion, outlineEntity, bColor, cColor, size, circleBillboard, disableDepthTest, animateColorIn_2, position, series, imgKey, currentImgKey, series, pos3d, prevPos3d, lStyle, bColor, cColor, width, lHeightRef, trackEntity;
4233
4233
  return __generator(this, function (_e) {
4234
4234
  switch (_e.label) {
4235
4235
  case 0:
@@ -4433,6 +4433,9 @@ var EntityRenderEnginePoint;
4433
4433
  cEntity.billboard.heightReference = new ConstantProperty(getHeightRef(style));
4434
4434
  cEntity.billboard.disableDepthTestDistance = new ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
4435
4435
  cEntity.billboard.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance));
4436
+ // Unset width/height.
4437
+ cEntity.billboard.width = undefined;
4438
+ cEntity.billboard.height = undefined;
4436
4439
  series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
4437
4440
  if (series.length > 1) {
4438
4441
  animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
@@ -4501,6 +4504,10 @@ var EntityRenderEnginePoint;
4501
4504
  });
4502
4505
  extrusion = getCylinderExtrusion(entity, params.tags, heightRef, style.CylinderFillExtrusion);
4503
4506
  hasOutline = outline && outlineWidth > 0;
4507
+ classification = ClassificationType.TERRAIN;
4508
+ if (style["drapeOver"] == "ALL") {
4509
+ classification = ClassificationType.BOTH;
4510
+ }
4504
4511
  if (!params.rendered || !params.rendered.ellipse) {
4505
4512
  cEntity = new Entity({
4506
4513
  id: ObjectUtils.UId(10),
@@ -4514,6 +4521,7 @@ var EntityRenderEnginePoint;
4514
4521
  extrudedHeightReference: extrusion.exHeightRef,
4515
4522
  height: Cartographic.fromCartesian(pos3d).height,
4516
4523
  zIndex: 1,
4524
+ classificationType: classification,
4517
4525
  distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance)
4518
4526
  },
4519
4527
  position: pos3d === null || pos3d === void 0 ? void 0 : pos3d.clone(),
@@ -4532,6 +4540,7 @@ var EntityRenderEnginePoint;
4532
4540
  cEntity.ellipse.height = new ConstantProperty(Cartographic.fromCartesian(pos3d).height);
4533
4541
  cEntity.ellipse.zIndex = new ConstantProperty(1);
4534
4542
  cEntity.ellipse.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance));
4543
+ cEntity.ellipse.classificationType = new ConstantProperty(classification);
4535
4544
  cEntity.position = new ConstantPositionProperty(pos3d === null || pos3d === void 0 ? void 0 : pos3d.clone());
4536
4545
  // We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
4537
4546
  // WARNING: ellipse does not support animation (yet?).
@@ -4561,6 +4570,7 @@ var EntityRenderEnginePoint;
4561
4570
  outlineEntity.ellipse.height = new ConstantProperty(Cartographic.fromCartesian(pos3d).height);
4562
4571
  outlineEntity.ellipse.zIndex = new ConstantProperty(2);
4563
4572
  outlineEntity.ellipse.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance));
4573
+ outlineEntity.ellipse.classificationType = new ConstantProperty(classification);
4564
4574
  // We'll use "SetDefaultColor" to updating the internal reference and to allow for an animation.
4565
4575
  // WARNING: ellipse does not support animation (yet?).
4566
4576
  CesiumEntityStyler.SetDefaultColor({
@@ -4585,6 +4595,7 @@ var EntityRenderEnginePoint;
4585
4595
  extrudedHeightReference: outlineExtrusion.exHeightRef,
4586
4596
  height: Cartographic.fromCartesian(pos3d).height,
4587
4597
  zIndex: 2,
4598
+ classificationType: classification,
4588
4599
  distanceDisplayCondition: EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance)
4589
4600
  },
4590
4601
  position: pos3d === null || pos3d === void 0 ? void 0 : pos3d.clone()
@@ -16063,6 +16074,183 @@ var TilesetCadRenderManager;
16063
16074
  TilesetCadRenderManager.Manager = Manager;
16064
16075
  })(TilesetCadRenderManager || (TilesetCadRenderManager = {}));
16065
16076
 
16077
+ var DataLabRenderManager;
16078
+ (function (DataLabRenderManager) {
16079
+ var Manager = /** @class */ (function () {
16080
+ function Manager(params) {
16081
+ this.getter = null;
16082
+ this.disposed = false;
16083
+ var viewer = params.viewer, item = params.item, apiGetter = params.apiGetter, monitor = params.monitor, visualsRegister = params.visualsRegister;
16084
+ this.viewer = viewer;
16085
+ this.item = item;
16086
+ this.apiGetter = apiGetter;
16087
+ this.monitor = monitor;
16088
+ this.visualsManager = visualsRegister;
16089
+ }
16090
+ Object.defineProperty(Manager.prototype, "Disposed", {
16091
+ get: function () {
16092
+ return this.disposed;
16093
+ },
16094
+ enumerable: false,
16095
+ configurable: true
16096
+ });
16097
+ Manager.prototype.Init = function () {
16098
+ var _this = this;
16099
+ var _a;
16100
+ if (this.disposed) {
16101
+ throw new Error("This manager has already been disposed.");
16102
+ }
16103
+ if (!((_a = this.item.CameraZoomSettings) === null || _a === void 0 ? void 0 : _a.length)) {
16104
+ this.item.CameraZoomSettings = [
16105
+ {
16106
+ MinZoom: 0,
16107
+ MaxZoom: 200000,
16108
+ DisplayType: ZoomControl.EDisplayType.Model3D,
16109
+ LODCategoryID: "glb",
16110
+ LODLevel: 0,
16111
+ StyleID: 0
16112
+ }
16113
+ ];
16114
+ }
16115
+ // Perform the initial query and subscribe to updates
16116
+ this.getter = new BatchedDataGetter.Getter([this.item.DataLabQueryID], this.monitor, 1);
16117
+ this.getter.OnUpdate.Subscribe(function (queryIds) {
16118
+ _this.onGetterUpdate(queryIds[0]);
16119
+ });
16120
+ this.getter.Start();
16121
+ };
16122
+ Manager.prototype.Dispose = function () {
16123
+ if (this.disposed) {
16124
+ return;
16125
+ }
16126
+ this.doDispose();
16127
+ };
16128
+ Manager.prototype.doDispose = function () {
16129
+ var _a;
16130
+ this.disposed = true;
16131
+ (_a = this.getter) === null || _a === void 0 ? void 0 : _a.Dispose();
16132
+ this.visualsManager.RemoveRegos({
16133
+ menuItemId: this.item.id
16134
+ });
16135
+ };
16136
+ Manager.prototype.onGetterUpdate = function (queryId) {
16137
+ var _a;
16138
+ return __awaiter(this, void 0, void 0, function () {
16139
+ var api, result, query, queryResult, error_1;
16140
+ var _b;
16141
+ return __generator(this, function (_c) {
16142
+ switch (_c.label) {
16143
+ case 0:
16144
+ if (this.disposed || this.viewer.isDestroyed()) {
16145
+ return [2 /*return*/];
16146
+ }
16147
+ _c.label = 1;
16148
+ case 1:
16149
+ _c.trys.push([1, 4, , 5]);
16150
+ api = this.apiGetter.getApi();
16151
+ return [4 /*yield*/, DataLab.Get({ api: api, queryId: queryId })];
16152
+ case 2:
16153
+ result = _c.sent();
16154
+ query = result.query;
16155
+ return [4 /*yield*/, DataLab.Run({ api: api, query: (_b = {},
16156
+ _b[DataLab.EReqKey.Primary] = {
16157
+ Items: ((_a = query === null || query === void 0 ? void 0 : query.PrimarySelectionCriteria) === null || _a === void 0 ? void 0 : _a.Items) || [],
16158
+ },
16159
+ _b) })];
16160
+ case 3:
16161
+ queryResult = _c.sent();
16162
+ this.renderDataLabEntities(queryResult.entities || []);
16163
+ return [3 /*break*/, 5];
16164
+ case 4:
16165
+ error_1 = _c.sent();
16166
+ console.error("Failed to perform query or render DataLab entities:", error_1);
16167
+ return [3 /*break*/, 5];
16168
+ case 5: return [2 /*return*/];
16169
+ }
16170
+ });
16171
+ });
16172
+ };
16173
+ Manager.prototype.renderDataLabEntities = function (entities) {
16174
+ return __awaiter(this, void 0, void 0, function () {
16175
+ var _a, updated, cEntities, i, entity, id, cEntity, rego;
16176
+ return __generator(this, function (_b) {
16177
+ switch (_b.label) {
16178
+ case 0:
16179
+ if (this.disposed || this.viewer.isDestroyed()) {
16180
+ return [2 /*return*/];
16181
+ }
16182
+ return [4 /*yield*/, EntityRenderEngine.Render({
16183
+ viewer: this.viewer,
16184
+ apiGetter: this.apiGetter,
16185
+ entities: entities,
16186
+ menuItemId: this.item.id,
16187
+ visualRegister: this.visualsManager,
16188
+ zoomControl: this.item.CameraZoomSettings
16189
+ })];
16190
+ case 1:
16191
+ _a = _b.sent(), updated = _a.updated, cEntities = _a.entities;
16192
+ for (i = 0; i < entities.length; i++) {
16193
+ entity = entities[i];
16194
+ id = entity.Bruce.ID;
16195
+ cEntity = cEntities.get(id);
16196
+ if (cEntity) {
16197
+ rego = this.visualsManager.GetRego({
16198
+ entityId: id,
16199
+ menuItemId: this.item.id
16200
+ });
16201
+ if (!rego) {
16202
+ this.visualsManager.AddRego({
16203
+ rego: {
16204
+ entityId: id,
16205
+ menuItemId: this.item.id,
16206
+ menuItemType: this.item.Type,
16207
+ visual: cEntity,
16208
+ priority: 0,
16209
+ entityTypeId: entity.Bruce["EntityType.ID"],
16210
+ accountId: this.apiGetter.accountId,
16211
+ name: cEntity.name
16212
+ },
16213
+ requestRender: false
16214
+ });
16215
+ }
16216
+ }
16217
+ else {
16218
+ this.visualsManager.RemoveRegos({
16219
+ entityId: id,
16220
+ menuItemId: this.item.id,
16221
+ requestRender: false
16222
+ });
16223
+ }
16224
+ }
16225
+ this.viewer.scene.requestRender();
16226
+ return [2 /*return*/];
16227
+ }
16228
+ });
16229
+ });
16230
+ };
16231
+ Manager.prototype.ReRender = function () {
16232
+ return __awaiter(this, void 0, void 0, function () {
16233
+ return __generator(this, function (_a) {
16234
+ switch (_a.label) {
16235
+ case 0:
16236
+ if (this.disposed) {
16237
+ return [2 /*return*/];
16238
+ }
16239
+ // Re-perform the query and render again
16240
+ return [4 /*yield*/, this.onGetterUpdate(this.item.DataLabQueryID)];
16241
+ case 1:
16242
+ // Re-perform the query and render again
16243
+ _a.sent();
16244
+ return [2 /*return*/];
16245
+ }
16246
+ });
16247
+ });
16248
+ };
16249
+ return Manager;
16250
+ }());
16251
+ DataLabRenderManager.Manager = Manager;
16252
+ })(DataLabRenderManager || (DataLabRenderManager = {}));
16253
+
16066
16254
  /**
16067
16255
  * This is a helper for making entity requests based on a grid area.
16068
16256
  * It will return grid cells based on given view-area then will remember when stuff-
@@ -20891,6 +21079,15 @@ var MenuItemManager;
20891
21079
  getters: params.getters
20892
21080
  });
20893
21081
  break;
21082
+ case MenuItem.EType.DataLab:
21083
+ rItem.renderManager = new DataLabRenderManager.Manager({
21084
+ viewer: this.viewer,
21085
+ item: params.item,
21086
+ apiGetter: params.apiGetter,
21087
+ monitor: this.sharedMonitor,
21088
+ visualsRegister: this.visualsRegister
21089
+ });
21090
+ break;
20894
21091
  // Any "none" type can be ignored. These are just containers for other items.
20895
21092
  case MenuItem.EType.None:
20896
21093
  break;
@@ -28280,7 +28477,7 @@ var WidgetViewBar = /** @class */ (function (_super) {
28280
28477
  return WidgetViewBar;
28281
28478
  }(Widget.AWidget));
28282
28479
 
28283
- var VERSION = "4.7.3";
28480
+ var VERSION = "4.7.5";
28284
28481
 
28285
- export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, 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 };
28482
+ 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 };
28286
28483
  //# sourceMappingURL=bruce-cesium.es5.js.map