bruce-cesium 6.1.4 → 6.1.5

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, ProjectViewTile, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, 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';
1
+ import { BruceEvent, Cartes, Entity as Entity$1, ProjectViewTile, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, Camera, 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, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HorizontalOrigin, VerticalOrigin, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Ion, Cesium3DTileColorBlendMode, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, NearFarScalar, OrthographicFrustum, EasingFunction, EllipsoidTerrainProvider, CesiumInspector, defined, ClockRange, Cesium3DTileset, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, KmlDataSource, Quaternion, Matrix3, Matrix4, SceneTransforms, NearFarScalar, Cesium3DTileset, IonResource, EllipsoidTerrainProvider, CesiumInspector, OrthographicFrustum, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, EasingFunction, PolygonPipeline, ScreenSpaceEventHandler, ScreenSpaceEventType, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, BoundingSphere, GeometryInstance, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -32795,7 +32795,7 @@ function createDOMLabel(viewer, id, name, colorCss) {
32795
32795
  label.innerHTML = `<div style="margin-bottom:0px">${name !== null && name !== void 0 ? name : ""}</div>`;
32796
32796
  label.setAttribute("style", `
32797
32797
  position: absolute;
32798
- z-index: 1000;
32798
+ z-index: 2; /* keep under app panels */
32799
32799
  display: none;
32800
32800
  pointer-events: none;
32801
32801
  padding: 6px 10px;
@@ -32818,7 +32818,6 @@ function createDOMLabel(viewer, id, name, colorCss) {
32818
32818
  return label;
32819
32819
  }
32820
32820
  function updateDOMLabel(viewer, label, pos3d) {
32821
- var _a;
32822
32821
  if (!viewer || viewer.isDestroyed() || !label || !pos3d) {
32823
32822
  return;
32824
32823
  }
@@ -32841,11 +32840,11 @@ function updateDOMLabel(viewer, label, pos3d) {
32841
32840
  label.style.display = "none";
32842
32841
  return;
32843
32842
  }
32844
- const opacity = Math.max(0.2, 1 - (distance / maxDistance));
32845
- const camHeight = ((_a = viewer.camera.positionCartographic) === null || _a === void 0 ? void 0 : _a.height) || distance;
32846
- const driver = Math.min(distance, camHeight);
32847
- const offsetX = 14 + Math.min(driver / 80, 30); // px
32848
- const offsetY = 12 + Math.min(driver / 100, 24); // px
32843
+ // Keep full opacity; no distance-based fading
32844
+ // Keep the label close to the cursor regardless of zoom
32845
+ // Use small, constant pixel offsets to bottom-right
32846
+ const offsetX = 12; // px
32847
+ const offsetY = 10; // px
32849
32848
  let leftPx = screenPos.x + offsetX;
32850
32849
  let topPx = screenPos.y + offsetY;
32851
32850
  const pad = 8;
@@ -32856,11 +32855,11 @@ function updateDOMLabel(viewer, label, pos3d) {
32856
32855
  label.style.left = `${leftPx}px`;
32857
32856
  label.style.top = `${topPx}px`;
32858
32857
  label.style.display = "block";
32859
- label.style.opacity = `${opacity}`;
32858
+ label.style.opacity = "1";
32860
32859
  }
32861
32860
  var LiveCursor;
32862
32861
  (function (LiveCursor) {
32863
- function Upsert({ viewer, id, name, colorCss, pos3d, entityId, image, showBillboard = true, showEllipse = true, billboardWidth = 30, billboardHeight = 30 }) {
32862
+ function Upsert({ viewer, id, name, colorCss, pos3d, entityId, image, showBillboard = true, showEllipse = true, billboardWidth = 30, billboardHeight = 30, labelZIndex }) {
32864
32863
  if (!labels[id]) {
32865
32864
  createDOMLabel(viewer, id, name !== null && name !== void 0 ? name : "", colorCss !== null && colorCss !== void 0 ? colorCss : "#3b82f6");
32866
32865
  }
@@ -32875,6 +32874,9 @@ var LiveCursor;
32875
32874
  labels[id].style.backgroundColor = colorCss;
32876
32875
  }
32877
32876
  }
32877
+ if (typeof labelZIndex === "number") {
32878
+ labels[id].style.zIndex = `${labelZIndex}`;
32879
+ }
32878
32880
  positions[id] = pos3d;
32879
32881
  viewers[id] = viewer;
32880
32882
  // Manage Cesium entity
@@ -32935,7 +32937,17 @@ var LiveCursor;
32935
32937
  if (!updaters[id]) {
32936
32938
  const remover = viewer.scene.postUpdate.addEventListener(() => {
32937
32939
  const label = labels[id];
32938
- const p = positions[id];
32940
+ let p = positions[id];
32941
+ // If we manage an entity with an animated position, follow its current value
32942
+ const ent = entities[id];
32943
+ if (ent === null || ent === void 0 ? void 0 : ent.position) {
32944
+ const posProp = ent.position;
32945
+ const date = viewer.scene.lastRenderTime || viewer.clock.currentTime;
32946
+ const val = (posProp === null || posProp === void 0 ? void 0 : posProp.getValue) ? posProp.getValue(date) : posProp;
32947
+ if (val && !isNaN(val.x)) {
32948
+ p = val;
32949
+ }
32950
+ }
32939
32951
  if (!label || !p) {
32940
32952
  return;
32941
32953
  }
@@ -33747,7 +33759,7 @@ class WidgetViewBar extends Widget.AWidget {
33747
33759
  }
33748
33760
  }
33749
33761
 
33750
- const VERSION = "6.1.4";
33762
+ const VERSION = "6.1.5";
33751
33763
 
33752
33764
  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 };
33753
33765
  //# sourceMappingURL=bruce-cesium.es5.js.map