bruce-cesium 6.1.6 → 6.1.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.
@@ -16305,6 +16305,7 @@ class TilesetStyler {
16305
16305
  // Once the style is loaded, we can queue the set for styling.
16306
16306
  this.stylePendingEntityIds = new Map();
16307
16307
  this.fallbackStyle = null;
16308
+ this.styleFallbackLoaded = false;
16308
16309
  this.loadingCounter = 0;
16309
16310
  // Entity IDs -> boolean to indicate if we should override the feature colour.
16310
16311
  this.overrideFeatureColor = new Map();
@@ -16542,6 +16543,7 @@ class TilesetStyler {
16542
16543
  var _a, _b;
16543
16544
  const counter = ++this.loadingCounter;
16544
16545
  this.styleMappingLoaded = false;
16546
+ this.styleFallbackLoaded = false;
16545
16547
  this.styleMappingsLoaded.clear();
16546
16548
  // Apply state changes.
16547
16549
  this.entityGatherer.Empty();
@@ -16553,7 +16555,11 @@ class TilesetStyler {
16553
16555
  api: this.api,
16554
16556
  styleId: fallbackStyleId
16555
16557
  });
16558
+ if (this.loadingCounter != counter) {
16559
+ return;
16560
+ }
16556
16561
  this.fallbackStyle = data;
16562
+ this.styleFallbackLoaded = true;
16557
16563
  }
16558
16564
  catch (e) {
16559
16565
  console.error(e);
@@ -16661,7 +16667,17 @@ class TilesetStyler {
16661
16667
  // then we can pass them to the gatherer now.
16662
16668
  const relatedIds = this.stylePendingEntityIds.get(styleMap.EntityTypeID);
16663
16669
  if (relatedIds) {
16664
- this.entityGatherer.Queue(Array.from(relatedIds));
16670
+ if (this.getTilesetFeatureNeedsFullData(styleMap.EntityTypeID)) {
16671
+ this.entityGatherer.Queue(Array.from(relatedIds));
16672
+ }
16673
+ else {
16674
+ relatedIds.forEach(id => {
16675
+ const rego = this.getEntityRego(id);
16676
+ if (rego) {
16677
+ this.styleTilesetFeature(rego);
16678
+ }
16679
+ });
16680
+ }
16665
16681
  this.stylePendingEntityIds.delete(styleMap.EntityTypeID);
16666
16682
  }
16667
16683
  }
@@ -16677,9 +16693,19 @@ class TilesetStyler {
16677
16693
  // Queue all Entities that are pending styling.
16678
16694
  const pendingKeys = this.stylePendingEntityIds.keys();
16679
16695
  for (const key of pendingKeys) {
16680
- const relatedIds = this.stylePendingEntityIds[key];
16696
+ const relatedIds = this.stylePendingEntityIds.get(key);
16681
16697
  if (relatedIds) {
16682
- this.entityGatherer.Queue(Array.from(relatedIds));
16698
+ if (this.getTilesetFeatureNeedsFullData(key)) {
16699
+ this.entityGatherer.Queue(Array.from(relatedIds));
16700
+ }
16701
+ else {
16702
+ relatedIds.forEach(id => {
16703
+ const rego = this.getEntityRego(id);
16704
+ if (rego) {
16705
+ this.styleTilesetFeature(rego);
16706
+ }
16707
+ });
16708
+ }
16683
16709
  }
16684
16710
  }
16685
16711
  this.stylePendingEntityIds.clear();
@@ -16725,6 +16751,14 @@ class TilesetStyler {
16725
16751
  this.styleTilesetFeature(rego);
16726
16752
  }
16727
16753
  }
16754
+ else if (!this.styleMappingsLoaded.has(typeId) && this.styleFallbackLoaded) {
16755
+ if (this.getTilesetFeatureNeedsFullData(typeId)) {
16756
+ needsDataIds.push(rego.entityId);
16757
+ }
16758
+ else {
16759
+ this.styleTilesetFeature(rego);
16760
+ }
16761
+ }
16728
16762
  else {
16729
16763
  if (!this.stylePendingEntityIds.has(typeId)) {
16730
16764
  this.stylePendingEntityIds.set(typeId, new Set());
@@ -16889,11 +16923,12 @@ var TilesetRenderEngine;
16889
16923
  }
16890
16924
  TilesetRenderEngine.OnTilesetReady = OnTilesetReady;
16891
16925
  function ApplyPosition(params) {
16892
- var _a;
16926
+ var _a, _b;
16893
16927
  const cTileset = params.cTileset;
16894
16928
  const root = cTileset.root;
16895
16929
  const position = params.position;
16896
- let location = ((_a = position.ucs) === null || _a === void 0 ? void 0 : _a.location) ? position.ucs.location : position.location;
16930
+ const ucsTransform = ((_a = position.ucs) === null || _a === void 0 ? void 0 : _a.transform) || {};
16931
+ let location = ((_b = position.ucs) === null || _b === void 0 ? void 0 : _b.location) ? position.ucs.location : position.location;
16897
16932
  let transform = position.transform;
16898
16933
  transform = {
16899
16934
  heading: 0,
@@ -16906,24 +16941,33 @@ var TilesetRenderEngine;
16906
16941
  ...transform
16907
16942
  };
16908
16943
  transform.scale = EnsureNumber(transform.scale);
16909
- if (transform.scale <= 0) {
16910
- transform.scale = 0.000001;
16911
- }
16912
- // If we're in model-space we'll just go at 0,0 lat/lon and no h/p/r from the coords.
16944
+ // In model-space we focus on the UCS.
16945
+ // There's no location as we center the view around it.
16946
+ // TODO: although we should render the model relative to the UCS.
16913
16947
  if (params.modelSpace) {
16914
16948
  location = null;
16915
16949
  transform = {
16916
- heading: 0,
16917
- pitch: 0,
16918
- roll: 0,
16919
- scale: EnsureNumber(transform.scale, 1),
16920
- x: 0,
16921
- y: 0,
16922
- z: 0
16950
+ heading: EnsureNumber(ucsTransform.heading, 0),
16951
+ pitch: EnsureNumber(ucsTransform.pitch, 0),
16952
+ roll: EnsureNumber(ucsTransform.roll, 0),
16953
+ scale: EnsureNumber(ucsTransform.scale, 1),
16954
+ x: EnsureNumber(ucsTransform.x, 0),
16955
+ y: EnsureNumber(ucsTransform.y, 0),
16956
+ z: EnsureNumber(ucsTransform.z, 0)
16923
16957
  };
16924
- if (transform.scale <= 0) {
16925
- transform.scale = 0.000001;
16926
- }
16958
+ }
16959
+ // If not in model-space then scale/add UCS transform to the entity transform.
16960
+ else {
16961
+ transform.scale *= EnsureNumber(ucsTransform.scale, 1);
16962
+ transform.heading += EnsureNumber(ucsTransform.heading, 0);
16963
+ transform.pitch += EnsureNumber(ucsTransform.pitch, 0);
16964
+ transform.roll += EnsureNumber(ucsTransform.roll, 0);
16965
+ transform.x += EnsureNumber(ucsTransform.x, 0);
16966
+ transform.y += EnsureNumber(ucsTransform.y, 0);
16967
+ transform.z += EnsureNumber(ucsTransform.z, 0);
16968
+ }
16969
+ if (transform.scale <= 0) {
16970
+ transform.scale = 0.000001;
16927
16971
  }
16928
16972
  /**
16929
16973
  * Very cursed.
@@ -33757,7 +33801,7 @@ class WidgetViewBar extends Widget.AWidget {
33757
33801
  }
33758
33802
  }
33759
33803
 
33760
- const VERSION = "6.1.6";
33804
+ const VERSION = "6.1.8";
33761
33805
 
33762
33806
  export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isOutlineChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, AssemblyRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, LiveCursor, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, 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, 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 };
33763
33807
  //# sourceMappingURL=bruce-cesium.es5.js.map