bruce-cesium 2.8.9 → 2.9.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, Bounds, EntityRelationType, DelayQueue, BatchedDataGetter, 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, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, JulianDate, SceneMode, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, createOsmBuildings, SceneTransforms, KmlDataSource, OrthographicFrustum, EasingFunction, Cesium3DTileset, Matrix4, Matrix3, IonResource, Ion, EllipsoidTerrainProvider, CesiumInspector, defined, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, Model, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, ScreenSpaceEventHandler, ScreenSpaceEventType, ColorMaterialProperty, GeometryInstance, BoundingSphere } from 'cesium';
3
+ import { Cartographic, JulianDate, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, Entity, Primitive, Cesium3DTileFeature, HeightReference, DistanceDisplayCondition, NearFarScalar, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, KmlDataSource, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, CesiumInspector, defined, SceneTransforms, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, Model, ScreenSpaceEventHandler, ScreenSpaceEventType, ColorMaterialProperty, Matrix3, Matrix4, GeometryInstance, IonResource, Ion, BoundingSphere } from 'cesium';
4
4
 
5
5
  var TIME_LAG = 300;
6
6
  var POSITION_CHECK_TIMER = 950;
@@ -10011,17 +10011,8 @@ var RelationsRenderManager;
10011
10011
  * @param relation
10012
10012
  */
10013
10013
  Manager.prototype.shouldRenderRelation = function (relation) {
10014
- var _a, _b, _c, _d;
10015
- if ((_a = this.item.relations) === null || _a === void 0 ? void 0 : _a.length) {
10016
- // Find group for the same relationship type.
10017
- var typeRelations = this.item.relations.find(function (x) { return x.relationTypeId == relation["Relation.Type.ID"]; });
10018
- // See if group contains the parent entity ID.
10019
- if ((_b = typeRelations === null || typeRelations === void 0 ? void 0 : typeRelations.entityIds) === null || _b === void 0 ? void 0 : _b.find(function (x) { return x == relation["Principal.Entity.ID"]; })) {
10020
- return true;
10021
- }
10022
- }
10023
- // Backwards compatability.
10024
- var renderedIds = (_d = (_c = this.item) === null || _c === void 0 ? void 0 : _c.BruceEntity) === null || _d === void 0 ? void 0 : _d.EntityIds;
10014
+ var _a, _b;
10015
+ var renderedIds = (_b = (_a = this.item) === null || _a === void 0 ? void 0 : _a.BruceEntity) === null || _b === void 0 ? void 0 : _b.EntityIds;
10025
10016
  if (!renderedIds) {
10026
10017
  return false;
10027
10018
  }
@@ -12806,7 +12797,6 @@ function assertIteration$1(viewer, iteration) {
12806
12797
  }
12807
12798
  /**
12808
12799
  * Renders DATA_VERSION = 1 navigator.
12809
- * param iteration
12810
12800
  * @param params
12811
12801
  * @param bookmark
12812
12802
  * @param view
@@ -12930,32 +12920,33 @@ function renderLegacyNavigator(iteration, params, bookmark, view) {
12930
12920
  }
12931
12921
  _f.label = 3;
12932
12922
  case 3:
12933
- if ((_e = bSettings === null || bSettings === void 0 ? void 0 : bSettings.drawnRelationEntityIDs) === null || _e === void 0 ? void 0 : _e.length) {
12934
- menuItem = {
12935
- id: RELATION_MENU_ITEM_ID,
12936
- Caption: "Entity relations",
12937
- BruceEntity: {
12938
- EntityIds: bSettings.drawnRelationEntityIDs
12939
- },
12940
- Type: MenuItem.EType.Relations
12941
- };
12942
- params.manager.RenderItem({
12923
+ if (!((_e = bSettings === null || bSettings === void 0 ? void 0 : bSettings.drawnRelationEntityIDs) === null || _e === void 0 ? void 0 : _e.length)) return [3 /*break*/, 5];
12924
+ menuItem = {
12925
+ id: RELATION_MENU_ITEM_ID,
12926
+ Caption: "Entity relations",
12927
+ BruceEntity: {
12928
+ EntityIds: bSettings.drawnRelationEntityIDs
12929
+ },
12930
+ Type: MenuItem.EType.Relations
12931
+ };
12932
+ return [4 /*yield*/, params.manager.RenderItem({
12943
12933
  apiGetter: params.apiGetter,
12944
12934
  getters: params.getters,
12945
12935
  item: menuItem
12946
- });
12947
- if (!assertIteration$1(params.viewer, iteration)) {
12948
- return [2 /*return*/];
12949
- }
12936
+ })];
12937
+ case 4:
12938
+ _f.sent();
12939
+ if (!assertIteration$1(params.viewer, iteration)) {
12940
+ return [2 /*return*/];
12950
12941
  }
12951
- return [2 /*return*/];
12942
+ _f.label = 5;
12943
+ case 5: return [2 /*return*/];
12952
12944
  }
12953
12945
  });
12954
12946
  });
12955
12947
  }
12956
12948
  /**
12957
12949
  * Renders DATA_VERSION > 1 navigator.
12958
- * @param iteration
12959
12950
  * @param params
12960
12951
  * @param bookmark
12961
12952
  * @param view
@@ -12963,7 +12954,7 @@ function renderLegacyNavigator(iteration, params, bookmark, view) {
12963
12954
  function renderNavigator(iteration, params, bookmark, view) {
12964
12955
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
12965
12956
  return __awaiter(this, void 0, void 0, function () {
12966
- var viewer, scene, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, labelledIds, curLabelledIds, toUnLabel, entityOpacityMap, entityId, opacity, imagery, legacyRelationIds, relations, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem, gOcclusion;
12957
+ var viewer, scene, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, clock, selectedIds, hiddenIds, isolatedIds, labelledIds, curLabelledIds, toUnLabel, entityOpacityMap, entityId, opacity, imagery, renderedRelationEntityIds, curEnabled, newItemIds, _i, curEnabled_1, id, menuItem, gOcclusion;
12967
12958
  return __generator(this, function (_7) {
12968
12959
  switch (_7.label) {
12969
12960
  case 0:
@@ -13249,20 +13240,16 @@ function renderNavigator(iteration, params, bookmark, view) {
13249
13240
  tiles: imagery,
13250
13241
  viewer: params.manager.Viewer,
13251
13242
  });
13252
- legacyRelationIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedEntityRelations;
13253
- if (!legacyRelationIds) {
13254
- legacyRelationIds = [];
13255
- }
13256
- relations = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedRelations;
13257
- if (!relations) {
13258
- relations = [];
13243
+ renderedRelationEntityIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.renderedEntityRelations;
13244
+ if (!renderedRelationEntityIds) {
13245
+ renderedRelationEntityIds = [];
13259
13246
  }
13260
13247
  curEnabled = params.manager.GetEnabledItemIds();
13261
13248
  newItemIds = (_5 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _5 !== void 0 ? _5 : [];
13262
13249
  for (_i = 0, curEnabled_1 = curEnabled; _i < curEnabled_1.length; _i++) {
13263
13250
  id = curEnabled_1[_i];
13264
- if ((newItemIds.indexOf(id) === -1 && id != RELATION_MENU_ITEM_ID) ||
13265
- (id == RELATION_MENU_ITEM_ID && !legacyRelationIds.length && !relations.length)) {
13251
+ if (newItemIds.indexOf(id) === -1 ||
13252
+ (id == RELATION_MENU_ITEM_ID && !renderedRelationEntityIds.length)) {
13266
13253
  params.manager.RemoveItemById({
13267
13254
  menuItemId: id
13268
13255
  });
@@ -13282,24 +13269,26 @@ function renderNavigator(iteration, params, bookmark, view) {
13282
13269
  }
13283
13270
  _7.label = 4;
13284
13271
  case 4:
13285
- if (legacyRelationIds.length || relations.length) {
13286
- menuItem = {
13287
- id: RELATION_MENU_ITEM_ID,
13288
- Caption: "Entity relations",
13289
- BruceEntity: {
13290
- EntityIds: legacyRelationIds
13291
- },
13292
- relations: relations,
13293
- Type: MenuItem.EType.Relations
13294
- };
13295
- params.manager.RenderItem({
13272
+ if (!renderedRelationEntityIds.length) return [3 /*break*/, 6];
13273
+ menuItem = {
13274
+ id: RELATION_MENU_ITEM_ID,
13275
+ Caption: "Entity relations",
13276
+ BruceEntity: {
13277
+ EntityIds: renderedRelationEntityIds
13278
+ },
13279
+ Type: MenuItem.EType.Relations
13280
+ };
13281
+ return [4 /*yield*/, params.manager.RenderItem({
13296
13282
  getters: params.getters,
13297
13283
  item: menuItem
13298
- });
13299
- if (!assertIteration$1(params.viewer, iteration)) {
13300
- return [2 /*return*/];
13301
- }
13284
+ })];
13285
+ case 5:
13286
+ _7.sent();
13287
+ if (!assertIteration$1(params.viewer, iteration)) {
13288
+ return [2 /*return*/];
13302
13289
  }
13290
+ _7.label = 6;
13291
+ case 6:
13303
13292
  gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
13304
13293
  if (gOcclusion == null) {
13305
13294
  gOcclusion = (_6 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _6 === void 0 ? void 0 : _6.groundOcclusion;
@@ -16213,7 +16202,7 @@ var ViewerUtils;
16213
16202
  ViewerUtils.CreateWidgets = CreateWidgets;
16214
16203
  })(ViewerUtils || (ViewerUtils = {}));
16215
16204
 
16216
- var VERSION$1 = "2.8.9";
16205
+ var VERSION$1 = "2.9.0";
16217
16206
 
16218
16207
  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, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
16219
16208
  //# sourceMappingURL=bruce-cesium.es5.js.map