无人机管理后台前端(已迁走)
chenyao
2025-09-15 5560b09cb96ef7564a901e514d7545767ae401c1
src/views/gridManagement/gridManagement.vue
@@ -398,7 +398,7 @@
  viewer.entities.removeAll()
  const { longitude, latitude } = cartesian3Convert(viewer.scene.pickPosition(movement.position), viewer)
  let result = await getLnglatAltitude(longitude, latitude, viewer)
  let height = result.height + 60
  let height = result.height + 2
  const point = { longitude, latitude, height }
  pointList.value.push(point)
  ShowTwoPoints()
@@ -410,23 +410,25 @@
    const position = Cesium.Cartesian3.fromDegrees(
      Number(item.longitude),
      Number(item.latitude),
      Number(item.height)
      Number(item.height),
    )
    viewer.entities.add({
      id: `point-${index}`,
      position: position,
      billboard: {
        image: new Cesium.ConstantProperty(newStartPoint),
        width: 40,
            height: 40,
      point: {
        pixelSize: 10,
        color: Cesium.Color.fromCssColorString('#FFFFFF'),
        clampToGround: true,
        heightReference: Cesium.HeightReference.NONE,
      },
    })
    viewer?.entities.add({
            id: 'placement-' + index,
            position: position,
            polyline: getPolyLine(viewer, { value: pointList.value }, index),
         })
    // viewer?.entities.add({
      //       id: 'placement-' + index,
      //       position: position,
      //       polyline: getPolyLine(viewer, { value: pointList.value }, index),
      //    })
  })
  if (pointList.value.length < 2) return
  const position1 = Cesium.Cartesian3.fromDegrees(
      Number(pointList.value[0].longitude),
      Number(pointList.value[0].latitude),
@@ -455,14 +457,15 @@
    viewer.entities.add({
      rectangle: {
          coordinates: Cesium.Rectangle.fromDegrees(west, south, east, north),
                        material: Cesium.Color.RED.withAlpha(0.5),
                        outline: true,
                        outlineColor: Cesium.Color.RED,
                        outlineWidth: 2,
                        height: 60,
                        extrudedHeight: 60,
                        heightReference: Cesium.HeightReference.NONE
        // disableDepthTestDistance: Number.POSITIVE_INFINITY,
        coordinates: Cesium.Rectangle.fromDegrees(west, south, east, north),
        material: Cesium.Color.RED.withAlpha(0.5),
        outline: true,
        outlineColor: Cesium.Color.RED,
        outlineWidth: 2,
        height: pointList.value[1].height,
        extrudedHeight: pointList.value[1].height,
        heightReference: Cesium.HeightReference.NONE,
      }
  });
    // 获取两点在屏幕上的位置