|
|
@@ -354,12 +354,20 @@ export function getMapCanvasRect() {
|
|
|
return { left: rect.left, top: rect.top, right: rect.right, bottom: rect.bottom }
|
|
|
}
|
|
|
|
|
|
+/** 点位/未关联设备的标记行:DOM overlay 的唯一真相(billboard 已让位视觉,实体恒 show=false)。 */
|
|
|
+function pointMarkerRow(kind, code) {
|
|
|
+ if (!code) return null
|
|
|
+ return (markerPlan.markers || []).find((item) => item && item.kind === kind && item.code === code) || null
|
|
|
+}
|
|
|
+
|
|
|
export function hasMapMarker(kind, code, pointCode = '', key = '') {
|
|
|
if (!instance || !instance.engine || !instance.viewer) return false
|
|
|
if (kind === 'facility-point') return Boolean(facilityMarkerFor(code, key))
|
|
|
- return kind === DEVICE_LAYER_KIND
|
|
|
- ? instance.engine.hasDeviceMarker(instance.viewer, code, pointCode)
|
|
|
- : instance.engine.hasPointMarker(instance.viewer, kind, code)
|
|
|
+ if (kind === DEVICE_LAYER_KIND) return instance.engine.hasDeviceMarker(instance.viewer, code, pointCode)
|
|
|
+ // 票 76(C4):点位视觉已交给 DOM overlay,billboard 实体恒 `show=false`(isShowing=false)——
|
|
|
+ // 再拿引擎实体当"标记存在"判据,详情面板锚定会恒判 marker-missing、面板 visibility:hidden,
|
|
|
+ // 表现为"点了点位镜头飞了但面板不弹"。标记计划才是 DOM 层的真相,存在判据以它为准。
|
|
|
+ return Boolean(pointMarkerRow(kind, code))
|
|
|
}
|
|
|
|
|
|
export function getMapMarkerAnchor(kind, code, pointCode = '', key = '') {
|
|
|
@@ -371,9 +379,18 @@ export function getMapMarkerAnchor(kind, code, pointCode = '', key = '') {
|
|
|
const plan = overlayFacilityPlanMarkerCached(marker)
|
|
|
return { ...at, iconSize: Math.max(plan.draw.width, plan.draw.height), panelGap: 12 }
|
|
|
}
|
|
|
- const anchor = kind === DEVICE_LAYER_KIND
|
|
|
- ? instance.engine.projectDeviceMarker(instance.viewer, code, pointCode)
|
|
|
- : instance.engine.projectPointMarker(instance.viewer, kind, code)
|
|
|
+ // 点位/未关联设备:与 DOM overlay 同一条投影(markerGroundHeight + 相机),
|
|
|
+ // 不再读已被隐藏的 billboard 实体——那样既拿不到坐标,也拿不到图标尺寸。
|
|
|
+ if (kind !== DEVICE_LAYER_KIND) {
|
|
|
+ const row = pointMarkerRow(kind, code)
|
|
|
+ const at = row && instance.projectMarkerPoint
|
|
|
+ ? instance.projectMarkerPoint(row.longitude, row.latitude, row)
|
|
|
+ : null
|
|
|
+ if (!at) return null
|
|
|
+ const plan = overlayPlanMarkerCached(row)
|
|
|
+ return { ...at, iconSize: Math.max(plan.draw.width, plan.draw.height), panelGap: 12 }
|
|
|
+ }
|
|
|
+ const anchor = instance.engine.projectDeviceMarker(instance.viewer, code, pointCode)
|
|
|
if (!anchor) return anchor
|
|
|
// 票 76(2026-10-26 走查补充①):面板让位的**确定性**规则。
|
|
|
// 旧实现只在「展开或预览」时给 panelGap:60,且不区分态 —— 于是
|