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.
@@ -32692,7 +32692,7 @@
32692
32692
  label.innerHTML = `<div style="margin-bottom:0px">${name !== null && name !== void 0 ? name : ""}</div>`;
32693
32693
  label.setAttribute("style", `
32694
32694
  position: absolute;
32695
- z-index: 1000;
32695
+ z-index: 2; /* keep under app panels */
32696
32696
  display: none;
32697
32697
  pointer-events: none;
32698
32698
  padding: 6px 10px;
@@ -32715,7 +32715,6 @@
32715
32715
  return label;
32716
32716
  }
32717
32717
  function updateDOMLabel(viewer, label, pos3d) {
32718
- var _a;
32719
32718
  if (!viewer || viewer.isDestroyed() || !label || !pos3d) {
32720
32719
  return;
32721
32720
  }
@@ -32738,11 +32737,11 @@
32738
32737
  label.style.display = "none";
32739
32738
  return;
32740
32739
  }
32741
- const opacity = Math.max(0.2, 1 - (distance / maxDistance));
32742
- const camHeight = ((_a = viewer.camera.positionCartographic) === null || _a === void 0 ? void 0 : _a.height) || distance;
32743
- const driver = Math.min(distance, camHeight);
32744
- const offsetX = 14 + Math.min(driver / 80, 30); // px
32745
- const offsetY = 12 + Math.min(driver / 100, 24); // px
32740
+ // Keep full opacity; no distance-based fading
32741
+ // Keep the label close to the cursor regardless of zoom
32742
+ // Use small, constant pixel offsets to bottom-right
32743
+ const offsetX = 12; // px
32744
+ const offsetY = 10; // px
32746
32745
  let leftPx = screenPos.x + offsetX;
32747
32746
  let topPx = screenPos.y + offsetY;
32748
32747
  const pad = 8;
@@ -32753,10 +32752,10 @@
32753
32752
  label.style.left = `${leftPx}px`;
32754
32753
  label.style.top = `${topPx}px`;
32755
32754
  label.style.display = "block";
32756
- label.style.opacity = `${opacity}`;
32755
+ label.style.opacity = "1";
32757
32756
  }
32758
32757
  (function (LiveCursor) {
32759
- function Upsert({ viewer, id, name, colorCss, pos3d, entityId, image, showBillboard = true, showEllipse = true, billboardWidth = 30, billboardHeight = 30 }) {
32758
+ function Upsert({ viewer, id, name, colorCss, pos3d, entityId, image, showBillboard = true, showEllipse = true, billboardWidth = 30, billboardHeight = 30, labelZIndex }) {
32760
32759
  if (!labels[id]) {
32761
32760
  createDOMLabel(viewer, id, name !== null && name !== void 0 ? name : "", colorCss !== null && colorCss !== void 0 ? colorCss : "#3b82f6");
32762
32761
  }
@@ -32771,6 +32770,9 @@
32771
32770
  labels[id].style.backgroundColor = colorCss;
32772
32771
  }
32773
32772
  }
32773
+ if (typeof labelZIndex === "number") {
32774
+ labels[id].style.zIndex = `${labelZIndex}`;
32775
+ }
32774
32776
  positions[id] = pos3d;
32775
32777
  viewers[id] = viewer;
32776
32778
  // Manage Cesium entity
@@ -32831,7 +32833,17 @@
32831
32833
  if (!updaters[id]) {
32832
32834
  const remover = viewer.scene.postUpdate.addEventListener(() => {
32833
32835
  const label = labels[id];
32834
- const p = positions[id];
32836
+ let p = positions[id];
32837
+ // If we manage an entity with an animated position, follow its current value
32838
+ const ent = entities[id];
32839
+ if (ent === null || ent === void 0 ? void 0 : ent.position) {
32840
+ const posProp = ent.position;
32841
+ const date = viewer.scene.lastRenderTime || viewer.clock.currentTime;
32842
+ const val = (posProp === null || posProp === void 0 ? void 0 : posProp.getValue) ? posProp.getValue(date) : posProp;
32843
+ if (val && !isNaN(val.x)) {
32844
+ p = val;
32845
+ }
32846
+ }
32835
32847
  if (!label || !p) {
32836
32848
  return;
32837
32849
  }
@@ -33642,7 +33654,7 @@
33642
33654
  }
33643
33655
  }
33644
33656
 
33645
- const VERSION = "6.1.4";
33657
+ const VERSION = "6.1.5";
33646
33658
 
33647
33659
  exports.VERSION = VERSION;
33648
33660
  exports.isOutlineChanged = isOutlineChanged;