吉安感知网项目-前端
罗广辉
2026-02-09 8739df8c235b3c36df0b47ddc20a691dadc7bb4f
applications/drone-command/src/components/map-container/device-map-container.vue
@@ -1,4 +1,4 @@
<template>
<template>
   <div class="map-shell">
      <CommonCesiumMap ref="mapRef" class="command-cesium map-container" :dom-id="props.containerId" :active="true"
         :flat-mode="false" :terrain="true" :layer-mode="4" :contour="false" :boundary="false"
@@ -466,7 +466,7 @@
         },
         {
            longitude: 114.963974,
            latitude:  27.132677,
            latitude: 27.132677,
            height: 320
         },
         {
@@ -513,22 +513,22 @@
            height: 400
         },
         {
            longitude: 114.925836,
            longitude: 114.925836,
            latitude: 27.096102,
            height: 400
         },
         {
            longitude: 114.928384,
            longitude: 114.928384,
            latitude: 27.095866,
            height: 400
         },
         {
            longitude: 114.929874,
            longitude: 114.929874,
            latitude: 27.096095,
            height: 400
         },
         {
            longitude: 114.931048,
            longitude: 114.931048,
            latitude: 27.097666,
            height: 400
         },
@@ -629,11 +629,11 @@
      const pos = isEntityPosition
         ? getBillboardPosition(track.billboard)
         : Cesium.Cartesian3.lerp(
               track.positions[seg],
               track.positions[seg + 1],
               ratio,
               new Cesium.Cartesian3()
           )
            track.positions[seg],
            track.positions[seg + 1],
            ratio,
            new Cesium.Cartesian3()
         )
      if (!pos) return
      if (!isEntityPosition) {
         track.billboard.position = pos
@@ -848,6 +848,7 @@
            width: 40,
            height: 56,
            verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
            disableDepthTestDistance: Number.POSITIVE_INFINITY,
         })
         billboard.id = entry.entityId
         devicePickMap.set(entry.entityId, { data: entry.data, billboard })
@@ -976,7 +977,7 @@
   if (!trimmed) return null
   try {
      return JSON.parse(trimmed)
   } catch (error) {}
   } catch (error) { }
   return null
}
@@ -1029,7 +1030,7 @@
                  .filter(radius => Number.isFinite(radius) && radius > 0)
               radii.forEach((radius, levelIndex) => {
                  const positions = buildEllipsePositions(centerCartesian, radius, radius)
               const style = BUFFER_LEVEL_STYLES[levelIndex] || BUFFER_LEVEL_STYLES[BUFFER_LEVEL_STYLES.length - 1]
                  const style = BUFFER_LEVEL_STYLES[levelIndex] || BUFFER_LEVEL_STYLES[BUFFER_LEVEL_STYLES.length - 1]
                  if (positions.length >= 3) {
                     shapes.push({
                        positions,
@@ -1380,6 +1381,20 @@
   viewer = null
   publicCesium = null
})
const getMap = () => {
   return mapRef.value?.getMap()
}
// 暴露给父组件调用
const flyTo = (options) => {
   mapRef.value?.flyToPoint(options)
}
defineExpose({
   getMap,
   flyTo
})
</script>
<style lang="scss" scoped>