Compare commits

...

3 Commits

Author SHA1 Message Date
Zzc
568e89686f Merge branch 'dev' of http://222.212.85.86:8222/bdzl2/bxztApp into dev 2025-11-25 11:40:41 +08:00
Zzc
2e948026a3 fix(3d-situational-awareness): 延迟实体添加直到地形准备就绪
将模拟点和路径起始标记的添加从初始化过程的早期阶段移动到地形完全加载之后。这通过确保CLAMP_TO_GROUND正确生效来防止标记在相机飞行期间漂浮。添加了渲染请求以触发即时渲染。
2025-11-25 11:40:36 +08:00
Zzc
ff767925af feat(3d-situational-awareness): 禁用地图标记的深度测试
为点实体和公告板添加 `disableDepthTestDistance` 属性,以确保标记无论地形或其他物体如何都保持可见
2025-11-25 11:38:41 +08:00
2 changed files with 56 additions and 24 deletions

View File

@ -176,7 +176,8 @@ export function useMapMarkers() {
pixelSize: 12, pixelSize: 12,
outlineColor: Cesium.Color.WHITE, outlineColor: Cesium.Color.WHITE,
outlineWidth: 2, outlineWidth: 2,
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
disableDepthTestDistance: Number.POSITIVE_INFINITY
} }
}) })
entities.push(pointEntity) entities.push(pointEntity)
@ -654,7 +655,8 @@ export function useMapMarkers() {
width: 48, width: 48,
height: 48, height: 48,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
heightReference: resolveBillboardHeightReference(result.samplingSucceeded) heightReference: resolveBillboardHeightReference(result.samplingSucceeded),
disableDepthTestDistance: Number.POSITIVE_INFINITY
}, },
properties: { properties: {
type, type,
@ -741,7 +743,8 @@ export function useMapMarkers() {
width: 48, width: 48,
height: 48, height: 48,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM, verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
heightReference: resolveBillboardHeightReference(result.samplingSucceeded) heightReference: resolveBillboardHeightReference(result.samplingSucceeded),
disableDepthTestDistance: Number.POSITIVE_INFINITY
}, },
properties: { properties: {
type: 'station', type: 'station',

View File

@ -694,28 +694,30 @@ const initializeScene = async () => {
}, },
}) })
// 3. // 3. - 10.5
const allMockPoints = mockDataService.getAllMockPoints() //
allMockPoints.forEach((point) => { // const allMockPoints = mockDataService.getAllMockPoints()
const config = // allMockPoints.forEach((point) => {
point.type === 'soldier' // const config =
? mockDataService.createPersonnelEntityConfig(point, soldierIcon) // point.type === 'soldier'
: mockDataService.createDeviceEntityConfig(point, deviceIcon) // ? mockDataService.createPersonnelEntityConfig(point, soldierIcon)
viewer.entities.add(config) // : mockDataService.createDeviceEntityConfig(point, deviceIcon)
}) // viewer.entities.add(config)
console.log(`[index.vue] 已添加 ${allMockPoints.length} 个模拟点位`) // })
// console.log(`[index.vue] ${allMockPoints.length} `)
// 4. "" // 4. ""- 10.5
const allPaths = mockDataService.getAllAnimationPaths() //
Object.entries(allPaths).forEach(([pathId, path]) => { // const allPaths = mockDataService.getAllAnimationPaths()
const icon = path.metadata.type === 'soldier' ? soldierIcon : deviceIcon // Object.entries(allPaths).forEach(([pathId, path]) => {
const config = mockDataService.createPathStartMarkerConfig( // const icon = path.metadata.type === 'soldier' ? soldierIcon : deviceIcon
{ ...path, id: pathId }, // const config = mockDataService.createPathStartMarkerConfig(
icon // { ...path, id: pathId },
) // icon
viewer.entities.add(config) // )
}) // viewer.entities.add(config)
console.log('[index.vue] 已添加 3 个路径起点标记') // })
// console.log('[index.vue] 3 ')
// 5. // 5.
mapClickHandler.setupClickHandler(viewer, registerEventHandler, registerPostRenderListener) mapClickHandler.setupClickHandler(viewer, registerEventHandler, registerPostRenderListener)
@ -781,6 +783,33 @@ const initializeScene = async () => {
console.log('[index.vue] 等待地形完全就绪...') console.log('[index.vue] 等待地形完全就绪...')
await new Promise(resolve => setTimeout(resolve, 1000)) await new Promise(resolve => setTimeout(resolve, 1000))
// 10.5.
console.log('[index.vue] 添加模拟点位...')
const allMockPoints = mockDataService.getAllMockPoints()
allMockPoints.forEach((point) => {
const config =
point.type === 'soldier'
? mockDataService.createPersonnelEntityConfig(point, soldierIcon)
: mockDataService.createDeviceEntityConfig(point, deviceIcon)
viewer.entities.add(config)
})
console.log(`[index.vue] 已添加 ${allMockPoints.length} 个模拟点位`)
// ""
const allPaths = mockDataService.getAllAnimationPaths()
Object.entries(allPaths).forEach(([pathId, path]) => {
const icon = path.metadata.type === 'soldier' ? soldierIcon : deviceIcon
const config = mockDataService.createPathStartMarkerConfig(
{ ...path, id: pathId },
icon
)
viewer.entities.add(config)
})
console.log('[index.vue] 已添加 3 个路径起点标记')
// CLAMP_TO_GROUND
viewer.scene.requestRender()
// 11. // 11.
console.log('[index.vue] 加载应急资源数据...') console.log('[index.vue] 加载应急资源数据...')
await loadEmergencyResources(DISASTER_CENTER.lon, DISASTER_CENTER.lat) await loadEmergencyResources(DISASTER_CENTER.lon, DISASTER_CENTER.lat)