bruce-cesium 5.2.0 → 5.2.1

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, 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, EntityAttachment, EntityAttachmentType, EntityAttribute, 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, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, HorizontalOrigin, VerticalOrigin, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, GeoJsonDataSource, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, OrthographicFrustum, EasingFunction, NearFarScalar, SceneTransforms, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, Cesium3DTileset, PolygonPipeline, Matrix4, Matrix3, IonResource, CesiumInspector, ClockRange, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, Quaternion, 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, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, EllipsoidTerrainProvider, sampleTerrainMostDetailed, defined, PolygonPipeline, CesiumInspector, ClockRange, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -16893,7 +16893,7 @@ var TilesetCadRenderManager;
16893
16893
  this.renderPriority = 0;
16894
16894
  }
16895
16895
  (async () => {
16896
- var _a, _b;
16896
+ var _a, _b, _c;
16897
16897
  let api = this.getters.GetBruceApi();
16898
16898
  let coords = null;
16899
16899
  let tileset = null;
@@ -16950,13 +16950,33 @@ var TilesetCadRenderManager;
16950
16950
  if (!tileset || this.disposed) {
16951
16951
  return;
16952
16952
  }
16953
+ // Get the model tree if it's in a separate file.
16954
+ // There is a setting that is more explicit but it's lying on the file name so can't trust it yet.
16955
+ if (((_a = tileset.settings) === null || _a === void 0 ? void 0 : _a["tilesetVersion"]) > 1) {
16956
+ try {
16957
+ const modelTreeUrl = Tileset.GetFileUrl({
16958
+ api: api,
16959
+ file: "model_tree.json",
16960
+ tilesetId: tileset.id,
16961
+ cacheToken: tileset.generateVersion,
16962
+ viaCdn: Boolean(this.item.cdnEnabled == null ? true : this.item.cdnEnabled)
16963
+ });
16964
+ this.modelTree = await api.get(modelTreeUrl);
16965
+ }
16966
+ catch (e) {
16967
+ console.error(e);
16968
+ }
16969
+ }
16970
+ if (this.disposed) {
16971
+ return;
16972
+ }
16953
16973
  // Render outside the shared process because we can't control file requests from Cesium.
16954
16974
  const cTileset = this.cTileset = await TilesetRenderEngine.Render({
16955
16975
  apiGetter: this.getters.GetBruceGetter(),
16956
16976
  tileset: tileset,
16957
16977
  viewer: this.viewer,
16958
16978
  coords: coords,
16959
- accountId: (_b = (_a = this.item.tileset) === null || _a === void 0 ? void 0 : _a.ClientAccountID) !== null && _b !== void 0 ? _b : this.getters.GetAccountId(),
16979
+ accountId: (_c = (_b = this.item.tileset) === null || _b === void 0 ? void 0 : _b.ClientAccountID) !== null && _c !== void 0 ? _c : this.getters.GetAccountId(),
16960
16980
  viaCdn: Boolean(this.item.cdnEnabled == null ? true : this.item.cdnEnabled),
16961
16981
  noMemoryLimit: this.item["noMaximumMemory"]
16962
16982
  });
@@ -17077,7 +17097,7 @@ var TilesetCadRenderManager;
17077
17097
  }
17078
17098
  };
17079
17099
  const setByEntityId = () => {
17080
- const bruceIdProp = propertyNames.find(x => String(x).toLowerCase() == "bruceid");
17100
+ const bruceIdProp = propertyNames.find(x => (String(x).toLowerCase() == "bruceid"));
17081
17101
  if (bruceIdProp) {
17082
17102
  rego.entityId = feature.getProperty(bruceIdProp);
17083
17103
  }
@@ -17135,6 +17155,13 @@ var TilesetCadRenderManager;
17135
17155
  getMetaByGeomId(geomId, tileset) {
17136
17156
  var _a;
17137
17157
  let modelTree = (_a = tileset === null || tileset === void 0 ? void 0 : tileset.extensions) === null || _a === void 0 ? void 0 : _a.modelTree;
17158
+ // Wasn't inside tileset.json and instead in a separate file.
17159
+ if (!modelTree) {
17160
+ modelTree = this.modelTree;
17161
+ }
17162
+ if (!modelTree) {
17163
+ return null;
17164
+ }
17138
17165
  return this.digMetaByGeomId(geomId, modelTree, [], 0);
17139
17166
  }
17140
17167
  digMetaByGeomId(geomId, branch, path, depth) {
@@ -29882,7 +29909,7 @@ class WidgetViewBar extends Widget.AWidget {
29882
29909
  }
29883
29910
  }
29884
29911
 
29885
- const VERSION = "5.2.0";
29912
+ const VERSION = "5.2.1";
29886
29913
 
29887
29914
  export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isHistoricMetadataChanged, 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, Walkthrough, 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 };
29888
29915
  //# sourceMappingURL=bruce-cesium.es5.js.map