bruce-cesium 4.5.2 → 4.5.4

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, AbstractApi, Session, EntityAttribute, EntityAttachment, EntityAttachmentType } 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, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, Session, AbstractApi, EntityAttribute, EntityAttachment, EntityAttachmentType } from 'bruce-models';
2
2
  import * as Cesium from 'cesium';
3
- import { Cartographic, JulianDate, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, 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, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, DistanceDisplayCondition, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6897,7 +6897,7 @@ var EntityRenderEnginePolyline;
6897
6897
  var posses = points.map(function (x) { return Cartesian3.fromDegrees(EnsureNumber(x.longitude), EnsureNumber(x.latitude), EnsureNumber(x.altitude)); });
6898
6898
  posses = CullDuplicateCPosses(posses);
6899
6899
  // 5 points should be enough to tell most bad data.
6900
- var CHECK_POINTS = 5;
6900
+ var CHECK_POINTS = 8;
6901
6901
  var MIN_LEN = 0.001;
6902
6902
  var MAX_LEN = 4500000;
6903
6903
  var totalLength = 0;
@@ -6956,6 +6956,12 @@ var EntityRenderEnginePolyline;
6956
6956
  classification = ClassificationType.BOTH;
6957
6957
  }
6958
6958
  var cEntity = null;
6959
+ // If we have a very short meter line, we'll render as px.
6960
+ // Corridors are dying when we are rendering tiny lines.
6961
+ var SCALE_BY_DISTANCE_THRESHOLD = 15;
6962
+ if (units == "m" && totalLength < SCALE_BY_DISTANCE_THRESHOLD && posses.length < 70) {
6963
+ units = "px";
6964
+ }
6959
6965
  if (!params.rendered || ((!params.rendered.polyline && units == "px") ||
6960
6966
  (!params.rendered.corridor && units == "m"))) {
6961
6967
  cEntity = new Entity({
@@ -24254,7 +24260,7 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
24254
24260
  var breaker = document.createElement("div");
24255
24261
  breaker.className = "NextspaceLeftPanelBreaker";
24256
24262
  this._element.appendChild(breaker);
24257
- 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 ");
24263
+ 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 ", "svg");
24258
24264
  var bottomBreaker = document.createElement("div");
24259
24265
  bottomBreaker.className = "NextspaceLeftPanelBottomBreaker";
24260
24266
  this._element.appendChild(bottomBreaker);
@@ -24283,9 +24289,23 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
24283
24289
  // We insert before the bottom breaker.
24284
24290
  var bottomBreaker = this._element.querySelector(".NextspaceLeftPanelBottomBreaker");
24285
24291
  var afterElement = bottomBreaker ? bottomBreaker.previousElementSibling : null;
24286
- this._addPanelTab(params.tab, params.title, params.svgStr, afterElement);
24292
+ var icon;
24293
+ var iconSource;
24294
+ if (params.iconSvgStr) {
24295
+ icon = params.iconSvgStr;
24296
+ iconSource = "svg";
24297
+ }
24298
+ else if (params.iconImgUrl) {
24299
+ icon = params.iconImgUrl;
24300
+ iconSource = "file-url";
24301
+ }
24302
+ else if (params.svgStr) {
24303
+ icon = params.svgStr;
24304
+ iconSource = "svg";
24305
+ }
24306
+ this._addPanelTab(params.tab, params.title, icon, iconSource, afterElement);
24287
24307
  };
24288
- WidgetLeftPanel.prototype._addPanelTab = function (tab, title, svgStr, afterElement) {
24308
+ WidgetLeftPanel.prototype._addPanelTab = function (tab, title, icon, iconSource, afterElement) {
24289
24309
  var _this = this;
24290
24310
  var tabButton = document.createElement("div");
24291
24311
  tabButton.setAttribute("widget-left-panel-tab", tab);
@@ -24293,12 +24313,20 @@ var WidgetLeftPanel = /** @class */ (function (_super) {
24293
24313
  tabButton.title = title;
24294
24314
  var buttonBookmarksIcon = document.createElement("div");
24295
24315
  buttonBookmarksIcon.className = "NextspaceLeftPanelButtonIcon";
24296
- var buttonBookmarksIconSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
24297
- buttonBookmarksIconSvg.setAttribute("viewBox", "0 0 32 32");
24298
- buttonBookmarksIconSvg.setAttribute("width", "32");
24299
- buttonBookmarksIconSvg.setAttribute("height", "32");
24300
- buttonBookmarksIconSvg.innerHTML = svgStr;
24301
- buttonBookmarksIcon.appendChild(buttonBookmarksIconSvg);
24316
+ if (iconSource == "svg") {
24317
+ var buttonBookmarksIconSvg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
24318
+ buttonBookmarksIconSvg.setAttribute("viewBox", "0 0 32 32");
24319
+ buttonBookmarksIconSvg.setAttribute("width", "32");
24320
+ buttonBookmarksIconSvg.setAttribute("height", "32");
24321
+ buttonBookmarksIconSvg.innerHTML = icon;
24322
+ buttonBookmarksIcon.appendChild(buttonBookmarksIconSvg);
24323
+ }
24324
+ else if (iconSource == "file-url") {
24325
+ var buttonBookmarksIconImg = document.createElement("img");
24326
+ buttonBookmarksIconImg.src = icon;
24327
+ buttonBookmarksIcon.appendChild(buttonBookmarksIconImg);
24328
+ buttonBookmarksIcon.setAttribute("style", "\n max-width: 32px;\n max-height: 32px;\n ");
24329
+ }
24302
24330
  tabButton.appendChild(buttonBookmarksIcon);
24303
24331
  tabButton.onclick = function () {
24304
24332
  if (_this._enabledPanelTab === tab) {
@@ -27439,7 +27467,7 @@ var ViewerUtils;
27439
27467
  ViewerUtils.GetEventTracker = GetEventTracker;
27440
27468
  })(ViewerUtils || (ViewerUtils = {}));
27441
27469
 
27442
- var VERSION = "4.5.2";
27470
+ var VERSION = "4.5.4";
27443
27471
 
27444
27472
  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, WidgetSearchBar, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
27445
27473
  //# sourceMappingURL=bruce-cesium.es5.js.map