Compare commits
3 Commits
00488a301f
...
568e89686f
| Author | SHA1 | Date | |
|---|---|---|---|
| 568e89686f | |||
| 2e948026a3 | |||
| ff767925af |
@ -176,7 +176,8 @@ export function useMapMarkers() {
|
||||
pixelSize: 12,
|
||||
outlineColor: Cesium.Color.WHITE,
|
||||
outlineWidth: 2,
|
||||
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND
|
||||
heightReference: Cesium.HeightReference.CLAMP_TO_GROUND,
|
||||
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
||||
}
|
||||
})
|
||||
entities.push(pointEntity)
|
||||
@ -654,7 +655,8 @@ export function useMapMarkers() {
|
||||
width: 48,
|
||||
height: 48,
|
||||
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
||||
heightReference: resolveBillboardHeightReference(result.samplingSucceeded)
|
||||
heightReference: resolveBillboardHeightReference(result.samplingSucceeded),
|
||||
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
||||
},
|
||||
properties: {
|
||||
type,
|
||||
@ -741,7 +743,8 @@ export function useMapMarkers() {
|
||||
width: 48,
|
||||
height: 48,
|
||||
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
|
||||
heightReference: resolveBillboardHeightReference(result.samplingSucceeded)
|
||||
heightReference: resolveBillboardHeightReference(result.samplingSucceeded),
|
||||
disableDepthTestDistance: Number.POSITIVE_INFINITY
|
||||
},
|
||||
properties: {
|
||||
type: 'station',
|
||||
|
||||
@ -694,28 +694,30 @@ const initializeScene = async () => {
|
||||
},
|
||||
})
|
||||
|
||||
// 3. 添加模拟点位(人员和设备)
|
||||
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} 个模拟点位`)
|
||||
// 3. 添加模拟点位(人员和设备)- 已移至步骤10.5(地形就绪后)
|
||||
// 原因:在地形加载前添加会导致相机飞行时标记悬浮
|
||||
// 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} 个模拟点位`)
|
||||
|
||||
// 4. 添加路径起点标记(用于"一键启动")
|
||||
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 个路径起点标记')
|
||||
// 4. 添加路径起点标记(用于"一键启动")- 已移至步骤10.5(地形就绪后)
|
||||
// 原因:在地形加载前添加会导致相机飞行时标记悬浮
|
||||
// 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 个路径起点标记')
|
||||
|
||||
// 5. 设置地图点击事件监听
|
||||
mapClickHandler.setupClickHandler(viewer, registerEventHandler, registerPostRenderListener)
|
||||
@ -781,6 +783,33 @@ const initializeScene = async () => {
|
||||
console.log('[index.vue] 等待地形完全就绪...')
|
||||
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. 加载应急资源数据(在地形就绪后)
|
||||
console.log('[index.vue] 加载应急资源数据...')
|
||||
await loadEmergencyResources(DISASTER_CENTER.lon, DISASTER_CENTER.lat)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user