bruce-cesium 4.2.8 → 4.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
- import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityHistoricData, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttribute, EntityAttachment, EntityAttachmentType, AbstractApi } from 'bruce-models';
1
+ import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityHistoricData, EntityCoords, 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, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorBlendMode, HeadingPitchRoll, Transforms, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, 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, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Quaternion, Intersect } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, ColorMaterialProperty, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorBlendMode, HeadingPitchRoll, Transforms, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, 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, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Quaternion, Intersect } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -23178,6 +23178,16 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
23178
23178
  enumerable: false,
23179
23179
  configurable: true
23180
23180
  });
23181
+ Object.defineProperty(WidgetLeftPanel.prototype, "OnBookmarkSelect", {
23182
+ get: function () {
23183
+ if (this._onBookmarkSelect == null) {
23184
+ this._onBookmarkSelect = new BruceEvent();
23185
+ }
23186
+ return this._onBookmarkSelect;
23187
+ },
23188
+ enumerable: false,
23189
+ configurable: true
23190
+ });
23181
23191
  Object.defineProperty(WidgetLeftPanel.prototype, "Loading", {
23182
23192
  get: function () {
23183
23193
  return this._loading;
@@ -23228,6 +23238,10 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
23228
23238
  };
23229
23239
  WidgetLeftPanel.prototype.Dispose = function () {
23230
23240
  _super.prototype.Dispose.call(this);
23241
+ if (this.envSubRemoval) {
23242
+ this.envSubRemoval();
23243
+ this.envSubRemoval = null;
23244
+ }
23231
23245
  if (this._enabledTabContent) {
23232
23246
  this._enabledTabContent.Dispose();
23233
23247
  this._enabledTabContent = null;
@@ -23240,21 +23254,36 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
23240
23254
  }
23241
23255
  var style = document.createElement("style");
23242
23256
  style.id = this.STYLESHEET_ID;
23243
- style.innerHTML = "\n .NextspaceLeftPanel {\n align-items: center;\n background-color: #21272a;\n cursor: default;\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n height: 100%;\n padding-bottom: 15px;\n padding-top: 15px;\n position: absolute;\n width: 50px;\n z-index: 1;\n top: 0;\n left: 0;\n }\n\n .NextspaceLeftPanel * {\n box-sizing: border-box;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelBreaker {\n background-color: hsla(0,0%,50%,.231);\n flex-shrink: 0;\n height: 2px;\n margin-bottom: 15px;\n width: calc(100% - 8px);\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton {\n border-radius: 3px;\n color: #fff;\n cursor: pointer;\n font-size: 18px;\n height: 32px;\n overflow: hidden;\n width: 32px;\n margin-bottom: 15px;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton:first-of-type {\n margin-bottom: 8px;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton >.NextspaceLeftPanelButtonIcon {\n align-items: center;\n display: flex;\n justify-content: center;\n position: relative;\n transition: .3s ease;\n height: 100%;\n width: 100%;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton >.NextspaceLeftPanelButtonIcon:hover {\n transform: scale(1.2);\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton >.NextspaceLeftPanelButtonIcon >svg {\n cursor: pointer;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton[is-enabled=\"true\"] >.NextspaceLeftPanelButtonIcon {\n background-color: #fff;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton[is-enabled=\"true\"] >.NextspaceLeftPanelButtonIcon >svg {\n filter: invert(1);\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelTabContent {\n display: none;\n width: 300px;\n height: 100%;\n position: absolute;\n top: 0;\n left: 50px;\n background-color: #21272a;\n padding: 40px 30px 30px;\n flex-direction: column;\n flex-grow: 1;\n flex-shrink: 1;\n overflow: hidden;\n }\n ";
23257
+ style.innerHTML = "\n .NextspaceLeftPanel {\n align-items: center;\n background-color: #21272a;\n cursor: default;\n display: flex;\n flex-direction: column;\n flex-shrink: 0;\n height: 100%;\n padding-top: 15px;\n position: absolute;\n width: 50px;\n z-index: 1;\n top: 0;\n left: 0;\n box-sizing: border-box;\n }\n\n .NextspaceLeftPanel * {\n box-sizing: border-box;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelBreaker {\n background-color: hsla(0,0%,50%,.231);\n flex-shrink: 0;\n height: 2px;\n margin-bottom: 15px;\n width: calc(100% - 8px);\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelBottomBreaker {\n margin-top: auto;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton {\n border-radius: 3px;\n color: #fff;\n cursor: pointer;\n font-size: 18px;\n height: 32px;\n overflow: hidden;\n width: 32px;\n margin-bottom: 15px;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton:first-of-type {\n margin-bottom: 8px;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton >.NextspaceLeftPanelButtonIcon {\n align-items: center;\n display: flex;\n justify-content: center;\n position: relative;\n transition: .3s ease;\n height: 100%;\n width: 100%;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton >.NextspaceLeftPanelButtonIcon:hover {\n transform: scale(1.2);\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton[no-content=\"true\"] {\n cursor: default;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton[no-content=\"true\"] >.NextspaceLeftPanelButtonIcon:hover {\n transform: none;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton >.NextspaceLeftPanelButtonIcon >svg {\n cursor: pointer;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton[is-enabled=\"true\"] >.NextspaceLeftPanelButtonIcon {\n background-color: #fff;\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton[is-enabled=\"true\"] >.NextspaceLeftPanelButtonIcon >svg {\n filter: invert(1);\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelButton[is-disabled=\"true\"] {\n opacity: .5;\n pointer-events: none\n }\n\n .NextspaceLeftPanel >.NextspaceLeftPanelTabContent {\n display: none;\n width: 300px;\n height: 100%;\n position: absolute;\n top: 0;\n left: 50px;\n background-color: #21272a;\n padding: 40px 30px 30px;\n flex-direction: column;\n flex-grow: 1;\n flex-shrink: 1;\n overflow: hidden;\n }\n\n .NextspaceLeftPanel .NextspaceLeftPanelTabContentCloseButton {\n color: #fff;\n cursor: pointer;\n opacity: .7;\n position: absolute;\n right: 22px;\n top: 14px;\n transition: transform .3s ease;\n z-index: 1;\n }\n\n .NextspaceLeftPanel .NextspaceLeftPanelTabContentCloseButton:hover {\n transform: scale(1.2);\n }\n ";
23244
23258
  document.head.appendChild(style);
23245
23259
  };
23246
23260
  WidgetLeftPanel.prototype._generateElement = function () {
23261
+ var _this = this;
23247
23262
  var element = document.createElement("div");
23248
23263
  element.className = "NextspaceLeftPanel";
23249
23264
  this.Container.appendChild(element);
23250
23265
  this._element = element;
23251
- this._addPlaceholderTab("Dashboard", "\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11 9C11 10.1046 10.1046 11 9 11C7.89543 11 7 10.1046 7 9C7 7.89543 7.89543 7 9 7C10.1046 7 11 7.89543 11 9ZM18 9C18 10.1046 17.1046 11 16 11C14.8954 11 14 10.1046 14 9C14 7.89543 14.8954 7 16 7C17.1046 7 18 7.89543 18 9ZM23 11C24.1046 11 25 10.1046 25 9C25 7.89543 24.1046 7 23 7C21.8954 7 21 7.89543 21 9C21 10.1046 21.8954 11 23 11ZM11 16C11 17.1046 10.1046 18 9 18C7.89543 18 7 17.1046 7 16C7 14.8954 7.89543 14 9 14C10.1046 14 11 14.8954 11 16ZM9 25C10.1046 25 11 24.1046 11 23C11 21.8954 10.1046 21 9 21C7.89543 21 7 21.8954 7 23C7 24.1046 7.89543 25 9 25ZM18 16C18 17.1046 17.1046 18 16 18C14.8954 18 14 17.1046 14 16C14 14.8954 14.8954 14 16 14C17.1046 14 18 14.8954 18 16ZM16 25C17.1046 25 18 24.1046 18 23C18 21.8954 17.1046 21 16 21C14.8954 21 14 21.8954 14 23C14 24.1046 14.8954 25 16 25ZM25 16C25 17.1046 24.1046 18 23 18C21.8954 18 21 17.1046 21 16C21 14.8954 21.8954 14 23 14C24.1046 14 25 14.8954 25 16ZM23 25C24.1046 25 25 24.1046 25 23C25 21.8954 24.1046 21 23 21C21.8954 21 21 21.8954 21 23C21 24.1046 21.8954 25 23 25Z\" fill=\"white\"></path>\n ");
23266
+ this._addPlaceholderTab("Dashboard", "\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M11 9C11 10.1046 10.1046 11 9 11C7.89543 11 7 10.1046 7 9C7 7.89543 7.89543 7 9 7C10.1046 7 11 7.89543 11 9ZM18 9C18 10.1046 17.1046 11 16 11C14.8954 11 14 10.1046 14 9C14 7.89543 14.8954 7 16 7C17.1046 7 18 7.89543 18 9ZM23 11C24.1046 11 25 10.1046 25 9C25 7.89543 24.1046 7 23 7C21.8954 7 21 7.89543 21 9C21 10.1046 21.8954 11 23 11ZM11 16C11 17.1046 10.1046 18 9 18C7.89543 18 7 17.1046 7 16C7 14.8954 7.89543 14 9 14C10.1046 14 11 14.8954 11 16ZM9 25C10.1046 25 11 24.1046 11 23C11 21.8954 10.1046 21 9 21C7.89543 21 7 21.8954 7 23C7 24.1046 7.89543 25 9 25ZM18 16C18 17.1046 17.1046 18 16 18C14.8954 18 14 17.1046 14 16C14 14.8954 14.8954 14 16 14C17.1046 14 18 14.8954 18 16ZM16 25C17.1046 25 18 24.1046 18 23C18 21.8954 17.1046 21 16 21C14.8954 21 14 21.8954 14 23C14 24.1046 14.8954 25 16 25ZM25 16C25 17.1046 24.1046 18 23 18C21.8954 18 21 17.1046 21 16C21 14.8954 21.8954 14 23 14C24.1046 14 25 14.8954 25 16ZM23 25C24.1046 25 25 24.1046 25 23C25 21.8954 24.1046 21 23 21C21.8954 21 21 21.8954 21 23C21 24.1046 21.8954 25 23 25Z\" fill=\"white\"></path>\n </svg>\n ");
23252
23267
  var breaker = document.createElement("div");
23253
23268
  breaker.className = "NextspaceLeftPanelBreaker";
23254
23269
  this._element.appendChild(breaker);
23255
- this._addPanelTab("bookmarks", "Bookmarks", "\n <path d=\"M23 25V7H9V25L16 18L23 25Z\" fill=\"white\" stroke=\"white\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n ");
23270
+ this._addPanelTab("bookmarks", "Bookmarks", "\n <svg width=\"32\" height=\"32\" viewBox=\"0 0 32 32\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M23 25V7H9V25L16 18L23 25Z\" fill=\"white\" stroke=\"white\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path>\n </svg>\n ");
23271
+ var bottomBreaker = document.createElement("div");
23272
+ bottomBreaker.className = "NextspaceLeftPanelBottomBreaker";
23273
+ this._element.appendChild(bottomBreaker);
23274
+ this._addUserProfileTab();
23256
23275
  var panelContent = document.createElement("div");
23257
23276
  panelContent.className = "NextspaceLeftPanelTabContent";
23277
+ var panelContentCloseButton = document.createElement("div");
23278
+ panelContentCloseButton.setAttribute("title", "Close");
23279
+ panelContentCloseButton.className = "NextspaceLeftPanelTabContentCloseButton";
23280
+ panelContentCloseButton.innerHTML = "\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M18.3002 5.70973C17.9102 5.31973 17.2802 5.31973 16.8902 5.70973L12.0002 10.5897L7.11022 5.69973C6.72022 5.30973 6.09021 5.30973 5.70021 5.69973C5.31021 6.08973 5.31021 6.71973 5.70021 7.10973L10.5902 11.9997L5.70021 16.8897C5.31021 17.2797 5.31021 17.9097 5.70021 18.2997C6.09021 18.6897 6.72022 18.6897 7.11022 18.2997L12.0002 13.4097L16.8902 18.2997C17.2802 18.6897 17.9102 18.6897 18.3002 18.2997C18.6902 17.9097 18.6902 17.2797 18.3002 16.8897L13.4102 11.9997L18.3002 7.10973C18.6802 6.72973 18.6802 6.08973 18.3002 5.70973Z\" fill=\"white\"></path></svg>\n ";
23281
+ panelContentCloseButton.onclick = function () {
23282
+ _this._enabledPanelTab = "";
23283
+ _this._updatePanelContent();
23284
+ _this._updatePanelStyles();
23285
+ };
23286
+ panelContent.appendChild(panelContentCloseButton);
23258
23287
  this._element.appendChild(panelContent);
23259
23288
  this._updatePanelStyles();
23260
23289
  };
@@ -23301,15 +23330,87 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
23301
23330
  tabButton.style.pointerEvents = "none";
23302
23331
  var buttonBookmarksIcon = document.createElement("div");
23303
23332
  buttonBookmarksIcon.className = "NextspaceLeftPanelButtonIcon";
23304
- var buttonBookmarksIconSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
23305
- buttonBookmarksIconSvg.setAttribute("viewBox", "0 0 32 32");
23306
- buttonBookmarksIconSvg.setAttribute("width", "32");
23307
- buttonBookmarksIconSvg.setAttribute("height", "32");
23308
- buttonBookmarksIconSvg.innerHTML = svgStr;
23309
- buttonBookmarksIcon.appendChild(buttonBookmarksIconSvg);
23333
+ buttonBookmarksIcon.innerHTML = svgStr;
23310
23334
  tabButton.appendChild(buttonBookmarksIcon);
23311
23335
  this._element.appendChild(tabButton);
23312
23336
  };
23337
+ /**
23338
+ * User profile handled separately.
23339
+ * This is because for a while it will be just an indicator of logged in user session.
23340
+ * It won't have a tab content.
23341
+ */
23342
+ WidgetLeftPanel.prototype._addUserProfileTab = function () {
23343
+ var tabButton = document.createElement("div");
23344
+ tabButton.className = "NextspaceLeftPanelButton";
23345
+ tabButton.setAttribute("title", "Not logged in");
23346
+ tabButton.setAttribute("no-content", "true");
23347
+ var buttonBookmarksIcon = document.createElement("div");
23348
+ buttonBookmarksIcon.className = "NextspaceLeftPanelButtonIcon";
23349
+ var LOGGED_OUT_ICON = "\n <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 12C14.21 12 16 10.21 16 8C16 5.79 14.21 4 12 4C9.79 4 8 5.79 8 8C8 10.21 9.79 12 12 12ZM12 14C9.33 14 4 15.34 4 18V19C4 19.55 4.45 20 5 20H19C19.55 20 20 19.55 20 19V18C20 15.34 14.67 14 12 14Z\" fill=\"white\"/>\n </svg>\n ";
23350
+ buttonBookmarksIcon.innerHTML = LOGGED_OUT_ICON;
23351
+ tabButton.appendChild(buttonBookmarksIcon);
23352
+ this._element.appendChild(tabButton);
23353
+ function getInitials(name) {
23354
+ var nameSplit = name.split(" ");
23355
+ if (nameSplit.length > 1) {
23356
+ return nameSplit[0][0] + nameSplit[1][0];
23357
+ }
23358
+ else {
23359
+ return nameSplit[0][0];
23360
+ }
23361
+ }
23362
+ function GetColorForString(str) {
23363
+ var stringUniqueHash = [].concat(str).reduce(function (acc, char) { return char.charCodeAt(0) + ((acc << 5) - acc); }, 0);
23364
+ return "hsl(".concat(stringUniqueHash % 360, ", 95%, 35%)");
23365
+ }
23366
+ /**
23367
+ * Updates the tab button based on the current user session.
23368
+ */
23369
+ function updateProfile() {
23370
+ var _a;
23371
+ return __awaiter(this, void 0, void 0, function () {
23372
+ var session, isLoggedIn, userName, initials, e_2;
23373
+ return __generator(this, function (_b) {
23374
+ switch (_b.label) {
23375
+ case 0:
23376
+ _b.trys.push([0, 2, , 3]);
23377
+ return [4 /*yield*/, Session.Get({
23378
+ sessionId: ENVIRONMENT.PARAMS.sessionId ? ENVIRONMENT.PARAMS.sessionId : "anonymous",
23379
+ })];
23380
+ case 1:
23381
+ session = (_b.sent()).session;
23382
+ isLoggedIn = session.ID != "anonymous" && ((_a = session.User) === null || _a === void 0 ? void 0 : _a.ID) != "anonymous";
23383
+ userName = session.User.FullName ? session.User.FullName : session.User.ID;
23384
+ tabButton.setAttribute("title", isLoggedIn ? userName : "Not logged in");
23385
+ // Draw a circle with the user's initials.
23386
+ if (isLoggedIn) {
23387
+ initials = getInitials(userName);
23388
+ buttonBookmarksIcon.innerHTML = "\n <div \n style=\"\n background-color: ".concat(GetColorForString(userName), "; \n color: white;\n border-radius: 50%;\n display: flex; \n align-items: center; \n justify-content: center; \n font-size: 12px;\n font-family: Arial;\n height: 100%; \n width: 100%;\">\n ").concat(initials, "\n </div>\n ");
23389
+ }
23390
+ else {
23391
+ buttonBookmarksIcon.innerHTML = LOGGED_OUT_ICON;
23392
+ }
23393
+ return [3 /*break*/, 3];
23394
+ case 2:
23395
+ e_2 = _b.sent();
23396
+ console.error(e_2);
23397
+ tabButton.setAttribute("title", "Not logged in");
23398
+ buttonBookmarksIcon.innerHTML = LOGGED_OUT_ICON;
23399
+ return [3 /*break*/, 3];
23400
+ case 3: return [2 /*return*/];
23401
+ }
23402
+ });
23403
+ });
23404
+ }
23405
+ if (this.envSubRemoval) {
23406
+ this.envSubRemoval();
23407
+ this.envSubRemoval = null;
23408
+ }
23409
+ this.envSubRemoval = ENVIRONMENT.OnParamsChange.Subscribe(function () {
23410
+ updateProfile();
23411
+ });
23412
+ updateProfile();
23413
+ };
23313
23414
  /**
23314
23415
  * Updates the panel styles based on the current state.
23315
23416
  * Eg: if a tab is enabled, the button should be highlighted.
@@ -23318,8 +23419,14 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
23318
23419
  var _this = this;
23319
23420
  var buttons = this._element.querySelectorAll(".NextspaceLeftPanelButton");
23320
23421
  buttons.forEach(function (button) {
23321
- var isEnabled = button.getAttribute("widget-left-panel-tab") === _this._enabledPanelTab;
23422
+ var buttonTab = button.getAttribute("widget-left-panel-tab");
23423
+ var isEnabled = buttonTab === _this._enabledPanelTab;
23322
23424
  button.setAttribute("is-enabled", isEnabled ? "true" : "false");
23425
+ // Disable for specific tabs.
23426
+ // Eg: bookmarks require a viewId.
23427
+ if (buttonTab === "bookmarks") {
23428
+ button.setAttribute("is-disabled", !_this._viewId ? "true" : "false");
23429
+ }
23323
23430
  });
23324
23431
  // Make the tab content visible/invisible based on the current state.
23325
23432
  var contentDisplayState = this._enabledPanelTab ? "flex" : "none";
@@ -23346,6 +23453,10 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
23346
23453
  });
23347
23454
  break;
23348
23455
  default:
23456
+ if (this.customTabs.has(this._enabledPanelTab) === false) {
23457
+ console.error("Tab ".concat(this._enabledPanelTab, " not found."));
23458
+ return;
23459
+ }
23349
23460
  tabContent = new (this.customTabs.get(this._enabledPanelTab)({
23350
23461
  widget: this,
23351
23462
  container: container
@@ -23382,6 +23493,9 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
23382
23493
  viewer: this._viewer,
23383
23494
  viewId: this._viewId
23384
23495
  });
23496
+ if (this._onBookmarkSelect) {
23497
+ this._onBookmarkSelect.Trigger(bookmark);
23498
+ }
23385
23499
  };
23386
23500
  return WidgetLeftPanel;
23387
23501
  }(Widget.AWidget));
@@ -26313,7 +26427,7 @@ var ViewerUtils;
26313
26427
  ViewerUtils.AssertIonToken = AssertIonToken;
26314
26428
  })(ViewerUtils || (ViewerUtils = {}));
26315
26429
 
26316
- var VERSION = "4.2.8";
26430
+ var VERSION = "4.3.0";
26317
26431
 
26318
26432
  export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, 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, WidgetSearchBar, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
26319
26433
  //# sourceMappingURL=bruce-cesium.es5.js.map