无人机管理后台前端(已迁走)
张含笑
2025-06-14 d9ba811d60810a8cd5e2eddaaa4decf6c6972f22
src/views/dataCenter/components/dataCenterMap.vue
@@ -25,7 +25,6 @@
const isShow = defineModel('show');
const viewerRef = shallowRef(null);
let viewer = null;
const store = useStore();
const currentAreaPosition = ref({ height: 1987280, latitude: 27.636112, longitude: 115.732975 });
let handler = null;
@@ -36,7 +35,6 @@
const isMapInitialized = ref(false); //地图加载
const dataPointList = ref([]);
const activeEntity = ref(null); // 当前激活的点
// 获取弹框box
const detailId = ref('');
const createLabelDom = data => {
@@ -51,7 +49,6 @@
  render(vNode, tooltipContainer);
  return tooltipContainer;
};
// 弹框位置刷新
const labelBoxUpdate = () => {
  if (!currentClickEntity) return;
@@ -84,15 +81,13 @@
const detailClick = () => {
  removeLabel();
  // 给父组件传值
  emit('update:show', false);
  // emit('update:show', false);  //关闭地图弹框
  emit('lookDetail', detailId.value);
};
// 恢复所有点的默认图标
const restoreAllIcons = () => {
  dataPointEntities.value.forEach(entity => {
    // console.log('entity.billboard.image', entity.billboard.image);
    if (entity.billboard) {
      entity.billboard.image =
        props.dotData.resultType === 2 ? getEventImage(entity.status) : defaultIcon;
@@ -246,6 +241,8 @@
  try {
    const res = await getMapInfoAPI(ids);
    dataPointList.value = res.data.data || [];
    console.log('dataPointList.value',dataPointList.value);
    // 确保地图已初始化后再渲染
    if (isMapInitialized.value && viewer) {
      renderDataPoint(dataPointList.value);