bruce-cesium 7.9.0 → 7.9.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 * as Cesium from 'cesium';
2
- import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, ConstantPositionProperty, HeightReference, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, Cartesian3, ClassificationType, ShaderSource, Math as Math$1, Ellipsoid, Transforms, Matrix4, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, Cartesian2, Cartesian4, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, PixelDatatype, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, ArcType, CornerType, JulianDate, Quaternion, HeadingPitchRoll, ColorBlendMode, Model, SceneMode, IntersectionTests, Ray, SceneTransforms, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, Rectangle, NearFarScalar, Matrix3, KmlDataSource, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Ion, IonResource, FeatureDetection, Cesium3DTileColorBlendMode, Cesium3DTileset, Intersect, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, WebGLConstants, OrthographicFrustum, EasingFunction, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, CesiumInspector, ClockRange, ShadowMode, DynamicEnvironmentMapManager, GeometryInstance, CustomDataSource, Event, PrimitiveCollection, PolylineCollection, LabelCollection, LabelStyle, Material, ScreenSpaceEventHandler, ScreenSpaceEventType, CameraEventType, Plane, OrientedBoundingBox, Fullscreen, CzmlDataSource } from 'cesium';
3
- import { Cartes, LRUCache, Carto, ProjectViewTile, EntityHistoricData, BruceEvent, DelayQueue, Entity as Entity$1, EntityTag, PathUtils, ClientFile, ENVIRONMENT, EntityAttachmentType, EntityRelationType, EntityType, Tileset, Calculator, DataLab, Style, ObjectUtils, MenuItem, AccountConcept, RecordChangeFeed, Api, Geometry as Geometry$1, EntityLod, UrlUtils, ProjectView, ProjectViewBookmark, ZoomControl, Assembly, EntityCoords, Bounds, ClientFileValueMap, Color as Color$1, EntityRelation, BruceApi, EntitySource, ProgramKey, ProjectViewLegacyTile, Camera, Account, AccountLimits, Session, EntityAttachment, EntityAttribute, MathUtils, ProjectViewBookmarkGroup } from 'bruce-models';
2
+ import { Cartographic, ColorMaterialProperty, Entity, Color, ConstantProperty, CallbackProperty, Primitive, Cesium3DTileFeature, Math as Math$1, Cartesian3, JulianDate, Quaternion, Transforms, HeadingPitchRoll, HeightReference, Matrix4, ShaderSource, Ellipsoid, Geometry, GeometryAttribute, ComponentDatatype, PrimitiveType, BoundingSphere, GeometryPipeline, Cartesian2, Cartesian4, sampleTerrain, Texture, PixelFormat, Sampler, TextureWrap, TextureMinificationFilter, TextureMagnificationFilter, PixelDatatype, VertexArray, BufferUsage, ShaderProgram, RenderState, BlendingState, DrawCommand, Pass, ConstantPositionProperty, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ColorBlendMode, Model, ImageMaterialProperty, PolygonHierarchy, PolylineGraphics, Rectangle, SceneMode, IntersectionTests, Ray, SceneTransforms, HorizontalOrigin, VerticalOrigin, NearFarScalar, Matrix3, KmlDataSource, FeatureDetection, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Ion, IonResource, Cesium3DTileColorBlendMode, Cesium3DTileset, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, Intersect, WebGLConstants, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, PrimitiveCollection, ShadowMode, PolylineCollection, LabelCollection, LabelStyle, Material, CustomDataSource, GeometryInstance, Event, CesiumInspector, ClockRange, DynamicEnvironmentMapManager, ScreenSpaceEventHandler, ScreenSpaceEventType, CameraEventType, Plane, OrientedBoundingBox, Fullscreen, CzmlDataSource } from 'cesium';
3
+ import { Cartes, LRUCache, Carto, ProjectViewTile, EntityHistoricData, BruceEvent, DelayQueue, Entity as Entity$1, EntityTag, PathUtils, ClientFile, ENVIRONMENT, EntityAttachmentType, EntityRelationType, EntityType, Tileset, Calculator, DataLab, Style, ObjectUtils, MenuItem, AccountConcept, RecordChangeFeed, Geometry as Geometry$1, EntityLod, UrlUtils, Bounds, ClientFileValueMap, Color as Color$1, ProjectView, ProjectViewBookmark, ZoomControl, Assembly, EntityCoords, Api, EntityRelation, BruceApi, EntitySource, Camera, ProgramKey, ProjectViewLegacyTile, Account, AccountLimits, Session, EntityAttachment, EntityAttribute, MathUtils, ProjectViewBookmarkGroup } from 'bruce-models';
4
4
 
5
5
  /**
6
6
  * Ensures a number is returned from a given value.
@@ -11116,7 +11116,7 @@ var EntityLabel;
11116
11116
  * If one exists then the action is ignored.
11117
11117
  */
11118
11118
  function Attach(params) {
11119
- var _a, _b, _c;
11119
+ var _a, _b, _c, _d;
11120
11120
  const { rego, viewer, pos3d, visualRegister, api, options, groupId } = params;
11121
11121
  if (!rego || !viewer) {
11122
11122
  return;
@@ -11127,8 +11127,8 @@ var EntityLabel;
11127
11127
  return Attach({
11128
11128
  ...params,
11129
11129
  pos3d: undefined,
11130
- options: (_a = group === null || group === void 0 ? void 0 : group.options) !== null && _a !== void 0 ? _a : options,
11131
- groupId: (_b = group === null || group === void 0 ? void 0 : group.groupId) !== null && _b !== void 0 ? _b : groupId,
11130
+ options: group ? group.options : (_b = (_a = visualRegister.GetLabelDefaults) === null || _a === void 0 ? void 0 : _a.call(visualRegister)) !== null && _b !== void 0 ? _b : options,
11131
+ groupId: (_c = group === null || group === void 0 ? void 0 : group.groupId) !== null && _c !== void 0 ? _c : groupId,
11132
11132
  persistent: true
11133
11133
  });
11134
11134
  }
@@ -11138,7 +11138,7 @@ var EntityLabel;
11138
11138
  if (rego[EntityLabel.ATTACH_KEY].Persistent && params.persistent !== true && !groupId) {
11139
11139
  return rego[EntityLabel.ATTACH_KEY];
11140
11140
  }
11141
- rego[EntityLabel.ATTACH_KEY].Persistent = (_c = params.persistent) !== null && _c !== void 0 ? _c : Boolean(groupId);
11141
+ rego[EntityLabel.ATTACH_KEY].Persistent = (_d = params.persistent) !== null && _d !== void 0 ? _d : Boolean(groupId);
11142
11142
  rego[EntityLabel.ATTACH_KEY].Configure(options, groupId);
11143
11143
  return rego[EntityLabel.ATTACH_KEY];
11144
11144
  }
@@ -13851,7 +13851,7 @@ function updateEntity(viewer, entityId, register, refresh, cache = {}) {
13851
13851
  viewer,
13852
13852
  api: (_b = register.ApiGetters) === null || _b === void 0 ? void 0 : _b.GetBruceApi(),
13853
13853
  visualRegister: register,
13854
- options: labelGroup === null || labelGroup === void 0 ? void 0 : labelGroup.options,
13854
+ options: labelGroup ? labelGroup.options : register.GetLabelDefaults(),
13855
13855
  groupId: labelGroup === null || labelGroup === void 0 ? void 0 : labelGroup.groupId,
13856
13856
  persistent: true
13857
13857
  });
@@ -14038,6 +14038,8 @@ var VisualsRegister;
14038
14038
  this.menuItemSources = new Map();
14039
14039
  // Set when the data source order no longer matches the zIndexes seen, so it is re-applied once.
14040
14040
  this.sourceOrderDirty = false;
14041
+ // The look of labelled Entities no label group holds.
14042
+ this.labelDefaults = null;
14041
14043
  // Stops following what is simulated, so labels can read it again when it changes.
14042
14044
  this.simulationRemoval = null;
14043
14045
  this.shadowsRemoval = null;
@@ -16892,6 +16894,25 @@ var VisualsRegister;
16892
16894
  var _a;
16893
16895
  return (_a = this.labelGroups) === null || _a === void 0 ? void 0 : _a.Resolve(entityId, menuItemId);
16894
16896
  }
16897
+ /*
16898
+ * How a labelled Entity in no label group is drawn, such as an account's default look; null draws plain text.
16899
+ */
16900
+ SetLabelDefaults(options) {
16901
+ if (this.disposed) {
16902
+ return;
16903
+ }
16904
+ const next = options ? { ...options } : null;
16905
+ if (JSON.stringify(next) === JSON.stringify(this.labelDefaults)) {
16906
+ return;
16907
+ }
16908
+ this.labelDefaults = next;
16909
+ for (const entityId of this.GetLabelled()) {
16910
+ this.queueUpdate({ entityId, refresh: false });
16911
+ }
16912
+ }
16913
+ GetLabelDefaults() {
16914
+ return this.labelDefaults ? { ...this.labelDefaults } : null;
16915
+ }
16895
16916
  /*
16896
16917
  * Called by a group label once it is on screen, so its entity's default image is read only when it can be seen.
16897
16918
  */
@@ -61275,7 +61296,7 @@ var StyleUtils;
61275
61296
  StyleUtils.ApplyTypeStyle = ApplyTypeStyle;
61276
61297
  })(StyleUtils || (StyleUtils = {}));
61277
61298
 
61278
- const VERSION = "7.9.0";
61299
+ const VERSION = "7.9.1";
61279
61300
  /**
61280
61301
  * Updates the environment instance used by bruce-cesium to one specified.
61281
61302
  * This can be used to ensure that the instance a parent is referencing is shared between bruce-cesium, bruce-models, and the parent app.