bruce-cesium 7.4.7 → 7.4.8

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 * as Cesium from 'cesium';
2
- import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, ShaderSource, Cartesian3, Math as Math$1, Ellipsoid, Transforms, Matrix4, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, Cartesian2, Cartesian4, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, HeightReference, ColorBlendMode, HeadingPitchRoll, ShadowMode, ClassificationType, Model, HorizontalOrigin, VerticalOrigin, ConstantPositionProperty, ArcType, CornerType, JulianDate, Quaternion, ImageMaterialProperty, DistanceDisplayCondition, PolygonHierarchy, PolylineGraphics, Rectangle, SceneTransforms, NearFarScalar, Matrix3, KmlDataSource, FeatureDetection, SceneMode, GeoJsonDataSource, Ion, IonResource, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileset, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Cesium3DTileColorBlendMode, Intersect, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, CesiumInspector, ClockRange, DynamicEnvironmentMapManager, ScreenSpaceEventHandler, ScreenSpaceEventType, GeometryInstance, Fullscreen, CustomDataSource, CzmlDataSource } from 'cesium';
3
- import { Cartes, LRUCache, ProjectViewTile, ENVIRONMENT, Calculator, ClientFile, Entity as Entity$1, EntityLod, EntityTag, EntityType, ObjectUtils, Style, Api, Carto, Geometry as Geometry$1, ClientFileValueMap, Color as Color$1, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, BruceEvent, EntityCoords, Bounds, DataLab, DelayQueue, AccountConcept, EntityRelation, BruceApi, RecordChangeFeed, EntitySource, Camera, ProgramKey, ProjectViewLegacyTile, Account, AccountLimits, Session, UrlUtils, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, ProjectViewBookmarkGroup, EntityRelationType, EntityHistoricData } from 'bruce-models';
2
+ import { Cartographic, Entity, ConstantPositionProperty, HeightReference, Color, DistanceDisplayCondition, ColorMaterialProperty, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, Matrix4, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, ColorBlendMode, ShadowMode, ClassificationType, Model, ShaderSource, Ellipsoid, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, Cartesian2, Cartesian4, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, ArcType, CornerType, Rectangle, HorizontalOrigin, VerticalOrigin, SceneTransforms, FeatureDetection, SceneMode, NearFarScalar, Matrix3, KmlDataSource, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Ion, IonResource, Cesium3DTileColorBlendMode, Cesium3DTileset, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, OrthographicFrustum, EasingFunction, Intersect, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, CesiumInspector, ClockRange, DynamicEnvironmentMapManager, CustomDataSource, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Fullscreen, CzmlDataSource } from 'cesium';
3
+ import { Cartes, LRUCache, ProjectViewTile, ENVIRONMENT, Calculator, ClientFile, Entity as Entity$1, EntityLod, EntityTag, EntityType, ObjectUtils, Style, Bounds, ClientFileValueMap, Color as Color$1, Geometry as Geometry$1, Api, Carto, MenuItem, ProjectView, ProjectViewBookmark, Tileset, ZoomControl, BruceEvent, EntityCoords, DataLab, DelayQueue, AccountConcept, BruceApi, RecordChangeFeed, EntityRelation, EntitySource, ProgramKey, ProjectViewLegacyTile, Camera, Account, AccountLimits, Session, UrlUtils, ProjectViewBookmarkGroup, EntityAttachment, EntityAttachmentType, EntityAttribute, MathUtils, EntityRelationType, EntityHistoricData } from 'bruce-models';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -31131,6 +31131,36 @@ class WidgetLeftPanelTabDashboard extends WidgetLeftPanelTab.ATab {
31131
31131
 
31132
31132
  const VIEWER_LEFT_PANEL_WIDGET_KEY = "_viewerLeftPanelWidget";
31133
31133
  const VIEWER_LEFT_PANEL_CSS_VAR_LEFT = "--nextspace-left-panel-width";
31134
+ // Size of a tab button's icon, and the drawing grid the built-in icons are authored on.
31135
+ const TAB_ICON_SIZE = 32;
31136
+ /**
31137
+ * Builds a tab's svg icon, fitted to the button whatever grid it was drawn on.
31138
+ */
31139
+ function CreateTabIconSvg(icon) {
31140
+ const SVG_NS = "http://www.w3.org/2000/svg";
31141
+ const parsed = /<svg[\s>]/i.test(icon !== null && icon !== void 0 ? icon : "") ? new DOMParser().parseFromString(icon, "image/svg+xml") : null;
31142
+ const root = parsed === null || parsed === void 0 ? void 0 : parsed.documentElement;
31143
+ let svg;
31144
+ if (root && root.localName === "svg" && !root.getElementsByTagName("parsererror").length) {
31145
+ svg = document.importNode(root, true);
31146
+ if (!svg.getAttribute("viewBox")) {
31147
+ // Without one the drawing would not scale, so its own size becomes the grid.
31148
+ const width = parseFloat(svg.getAttribute("width"));
31149
+ const height = parseFloat(svg.getAttribute("height"));
31150
+ if (width > 0 && height > 0) {
31151
+ svg.setAttribute("viewBox", `0 0 ${width} ${height}`);
31152
+ }
31153
+ }
31154
+ }
31155
+ else {
31156
+ svg = document.createElementNS(SVG_NS, "svg");
31157
+ svg.setAttribute("viewBox", `0 0 ${TAB_ICON_SIZE} ${TAB_ICON_SIZE}`);
31158
+ svg.innerHTML = icon !== null && icon !== void 0 ? icon : "";
31159
+ }
31160
+ svg.setAttribute("width", String(TAB_ICON_SIZE));
31161
+ svg.setAttribute("height", String(TAB_ICON_SIZE));
31162
+ return svg;
31163
+ }
31134
31164
  class WidgetLeftPanel extends Widget.AWidget {
31135
31165
  get ViewId() {
31136
31166
  return this._viewId;
@@ -31229,7 +31259,7 @@ class WidgetLeftPanel extends Widget.AWidget {
31229
31259
  if (this._viewId !== viewId) {
31230
31260
  return;
31231
31261
  }
31232
- this.bookmarks = data.bookmarks;
31262
+ this.bookmarks = data.bookmarks.filter(ViewRenderEngine.IsBookmarkSupported);
31233
31263
  this.bookmarkGroups = groups;
31234
31264
  }
31235
31265
  catch (e) {
@@ -31351,6 +31381,18 @@ class WidgetLeftPanel extends Widget.AWidget {
31351
31381
  cursor: pointer;
31352
31382
  }
31353
31383
 
31384
+ .NextspaceLeftPanel >.NextspaceLeftPanelButton >.NextspaceLeftPanelButtonIcon >img {
31385
+ display: block;
31386
+ max-width: 100%;
31387
+ max-height: 100%;
31388
+ object-fit: contain;
31389
+ }
31390
+
31391
+ .NextspaceLeftPanel >.NextspaceLeftPanelButton >.NextspaceLeftPanelButtonIcon >i {
31392
+ color: #fff;
31393
+ font-size: 18px;
31394
+ }
31395
+
31354
31396
  .NextspaceLeftPanel >.NextspaceLeftPanelButton[is-enabled="true"] >.NextspaceLeftPanelButtonIcon {
31355
31397
  background-color: #fff;
31356
31398
  }
@@ -31359,6 +31401,10 @@ class WidgetLeftPanel extends Widget.AWidget {
31359
31401
  filter: invert(1);
31360
31402
  }
31361
31403
 
31404
+ .NextspaceLeftPanel >.NextspaceLeftPanelButton[is-enabled="true"] >.NextspaceLeftPanelButtonIcon >i {
31405
+ color: #000;
31406
+ }
31407
+
31362
31408
  .NextspaceLeftPanel >.NextspaceLeftPanelButton[is-disabled="true"] {
31363
31409
  opacity: .5;
31364
31410
  pointer-events: none
@@ -31462,6 +31508,10 @@ class WidgetLeftPanel extends Widget.AWidget {
31462
31508
  icon = params.iconImgUrl;
31463
31509
  iconSource = "file-url";
31464
31510
  }
31511
+ else if (params.iconFontClass) {
31512
+ icon = params.iconFontClass;
31513
+ iconSource = "font";
31514
+ }
31465
31515
  else if (params.svgStr) {
31466
31516
  icon = params.svgStr;
31467
31517
  iconSource = "svg";
@@ -31476,21 +31526,17 @@ class WidgetLeftPanel extends Widget.AWidget {
31476
31526
  const buttonBookmarksIcon = document.createElement("div");
31477
31527
  buttonBookmarksIcon.className = "NextspaceLeftPanelButtonIcon";
31478
31528
  if (iconSource == "svg") {
31479
- const buttonBookmarksIconSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
31480
- buttonBookmarksIconSvg.setAttribute("viewBox", "0 0 32 32");
31481
- buttonBookmarksIconSvg.setAttribute("width", "32");
31482
- buttonBookmarksIconSvg.setAttribute("height", "32");
31483
- buttonBookmarksIconSvg.innerHTML = icon;
31484
- buttonBookmarksIcon.appendChild(buttonBookmarksIconSvg);
31529
+ buttonBookmarksIcon.appendChild(CreateTabIconSvg(icon));
31485
31530
  }
31486
31531
  else if (iconSource == "file-url") {
31487
31532
  const buttonBookmarksIconImg = document.createElement("img");
31488
31533
  buttonBookmarksIconImg.src = icon;
31489
31534
  buttonBookmarksIcon.appendChild(buttonBookmarksIconImg);
31490
- buttonBookmarksIcon.setAttribute("style", `
31491
- max-width: 32px;
31492
- max-height: 32px;
31493
- `);
31535
+ }
31536
+ else if (iconSource == "font") {
31537
+ const buttonBookmarksIconFont = document.createElement("i");
31538
+ buttonBookmarksIconFont.className = icon;
31539
+ buttonBookmarksIcon.appendChild(buttonBookmarksIconFont);
31494
31540
  }
31495
31541
  tabButton.appendChild(buttonBookmarksIcon);
31496
31542
  tabButton.onclick = () => {
@@ -34172,6 +34218,27 @@ async function renderNavigator(iteration, params, bookmark, view, getters) {
34172
34218
  }
34173
34219
  var ViewRenderEngine;
34174
34220
  (function (ViewRenderEngine) {
34221
+ const SUPPORTED_CONTENT_TYPES = [
34222
+ ProjectViewBookmark.EContentType.WEB_3D,
34223
+ ProjectViewBookmark.EContentType.WEB_3D_MODEL_SPACE,
34224
+ ProjectViewBookmark.EContentType.WEB_3D_SPLIT_PLUGIN
34225
+ ];
34226
+ /**
34227
+ * Whether a bookmark is a Cesium scene this engine can render.
34228
+ */
34229
+ function IsBookmarkSupported(bookmark) {
34230
+ var _a, _b;
34231
+ if (!bookmark) {
34232
+ return false;
34233
+ }
34234
+ const bSettings = ((_a = bookmark.Settings) !== null && _a !== void 0 ? _a : {});
34235
+ if (bSettings.contentType) {
34236
+ return SUPPORTED_CONTENT_TYPES.includes(bSettings.contentType);
34237
+ }
34238
+ // A bookmark ported from the 2D Navigator carries a zoom level rather than a 3D camera.
34239
+ return typeof ((_b = bSettings.camera) === null || _b === void 0 ? void 0 : _b.zoom) !== "number";
34240
+ }
34241
+ ViewRenderEngine.IsBookmarkSupported = IsBookmarkSupported;
34175
34242
  async function Render(params) {
34176
34243
  var _a, _b;
34177
34244
  if (!params.manager && params.viewer) {
@@ -34472,7 +34539,7 @@ class WidgetBookmarks extends Widget.AWidget {
34472
34539
  if (counter != this.reloadCounter) {
34473
34540
  return;
34474
34541
  }
34475
- this.bookmarks = data.bookmarks;
34542
+ this.bookmarks = data.bookmarks.filter(ViewRenderEngine.IsBookmarkSupported);
34476
34543
  }
34477
34544
  catch (e) {
34478
34545
  console.error(e);
@@ -50883,7 +50950,7 @@ var StyleUtils;
50883
50950
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
50884
50951
  })(StyleUtils || (StyleUtils = {}));
50885
50952
 
50886
- const VERSION = "7.4.7";
50953
+ const VERSION = "7.4.8";
50887
50954
  /**
50888
50955
  * Updates the environment instance used by bruce-cesium to one specified.
50889
50956
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.
@@ -50900,5 +50967,5 @@ const getENVIRONMENT = () => {
50900
50967
  return ENVIRONMENT;
50901
50968
  };
50902
50969
 
50903
- export { VERSION, setENVIRONMENT, getENVIRONMENT, ClusterItems, PointClustering, PointClusterSize, CesiumAnimatedInOut, DisplacedSurfacePrimitive, CesiumAnimatedProperty, isStyleChanged, isOutlineChanged$1 as isOutlineChanged, StyleEffective, EntityRenderEngine, EntityRenderEngineModel3d, EntityRenderEnginePoint, EntityRenderEnginePolygon, EntityRenderEnginePolyline, TextureFrameSeriesAnimator, TextureValueLabels, MenuItemCreator, MenuItemManager, CesiumParabola, EntityLabel, EntityLabelGroup, LiveCursor, SharedGetters, DataSourceStaticKmlManager, DataLabRenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, AssemblyRenderManager, GoogleSearchRenderManager, RelationsRenderManager, RenderManager, TilesetArbRenderManager, TilesetCadRenderManager, TilesetEntitiesRenderManager, TilesetGooglePhotosRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TileRenderEngine, createTileset, TilesetRenderEngine, ViewRenderEngine, VisualRegisterCuller, VisualsRegister, XGridsRenderEngine, CesiumEntityStyler, DrawingUtils, EntityUtils, MeasureUtils, StyleUtils, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, DEFAULT_BRIGHTNESS_SHIFT, DEFAULT_LIGHT_INTENSITY, LIGHTING_SETTINGS_VERSION, LIGHT_INTENSITY_COMPENSATION, MAX_COMPENSATED_LIGHT_INTENSITY, ViewUtils, CesiumViewMonitor, ViewGroundArea, ViewerEventTracker, ViewerUtils, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, WidgetControlViewBar, WidgetControlViewBarSearch, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks, WidgetLeftPanelTabDashboard, EMenuItemState, WidgetLeftPanelTabMenuItems, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, ECursor, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar };
50970
+ export { VERSION, setENVIRONMENT, getENVIRONMENT, ClusterItems, PointClustering, PointClusterSize, CesiumAnimatedInOut, DisplacedSurfacePrimitive, CesiumAnimatedProperty, isStyleChanged, isOutlineChanged$1 as isOutlineChanged, StyleEffective, EntityRenderEngine, EntityRenderEngineModel3d, EntityRenderEnginePoint, EntityRenderEnginePolygon, EntityRenderEnginePolyline, TextureFrameSeriesAnimator, TextureValueLabels, MenuItemCreator, MenuItemManager, CesiumParabola, EntityLabel, EntityLabelGroup, LiveCursor, SharedGetters, DataSourceStaticKmlManager, DataLabRenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, AssemblyRenderManager, GoogleSearchRenderManager, RelationsRenderManager, RenderManager, TilesetArbRenderManager, TilesetCadRenderManager, TilesetEntitiesRenderManager, TilesetGooglePhotosRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TileRenderEngine, createTileset, TilesetRenderEngine, ViewRenderEngine, VisualRegisterCuller, VisualsRegister, XGridsRenderEngine, CesiumEntityStyler, DrawingUtils, EntityUtils, MeasureUtils, StyleUtils, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_KEY, CESIUM_TIMELINE_INTERVAL_KEY, CESIUM_MODEL_SPACE_KEY, DEFAULT_LIVE_PADDING_SECONDS, DEFAULT_BRIGHTNESS_SHIFT, DEFAULT_LIGHT_INTENSITY, LIGHTING_SETTINGS_VERSION, LIGHT_INTENSITY_COMPENSATION, MAX_COMPENSATED_LIGHT_INTENSITY, ViewUtils, CesiumViewMonitor, ViewGroundArea, ViewerEventTracker, ViewerUtils, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, WidgetControlViewBar, WidgetControlViewBarSearch, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks, WidgetLeftPanelTabDashboard, EMenuItemState, WidgetLeftPanelTabMenuItems, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, ECursor, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, CreateTabIconSvg, WidgetLeftPanel, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar };
50904
50971
  //# sourceMappingURL=bruce-cesium.es5.js.map