wangjuncheng
2025-05-19 f5688d9765782bbb97b3abb8ee99fe7b9834a149
src/components/tools/LayerTree.vue
@@ -196,6 +196,18 @@
  }
  return;
}
if (label === "孙胡沟隐患点") {
    simStore.DangerShowSwitch = checked;
    if (checked) {
    if (!treeMap.get("孙胡沟隐患点")) {
    } else {
      toggleLayerVisible("孙胡沟隐患点", true);
    }
  } else {
    toggleLayerVisible("孙胡沟隐患点", false);
  }
  return;
}
  // 其他图层的处理逻辑
  const list = treeMap.get(label);
@@ -231,7 +243,7 @@
  } else if (entityList && typeof entityList.show !== "undefined") {
    entityList.show = checked;
  } else {
    console.error(`无法设置图层 ${name} 的可见性`);
    // console.error(`无法设置图层 ${name} 的可见性`);
  }
}
@@ -264,31 +276,31 @@
}
// 隐患点列表
watchEffect(() => {
  const dangerPoints = simStore.DangerPoint.filter((item) =>
    item.position?.includes("孙胡沟")
  );
// watchEffect(() => {
//   const dangerPoints = simStore.DangerPoint.filter((item) =>
//     item.position?.includes("孙胡沟")
//   );
  if (dangerPoints && dangerPoints.length > 0) {
    const list = [];
//   if (dangerPoints && dangerPoints.length > 0) {
//     const list = [];
    dangerPoints.forEach((item) => {
      // console.log(item, "item");
      item.id = item.hdId;
      item.name = item.hdName;
      item.latitude = item.lat;
      item.longitude = item.lon;
      item.showBillboard = true;
      item.type = item.disasterType;
      item.className = "district";
      const entity = createPoint(item);
      entity.show = false;
      list.push(entity);
    });
//     dangerPoints.forEach((item) => {
//       // console.log(item, "item");
//       item.id = item.hdId;
//       item.name = item.hdName;
//       item.latitude = item.lat;
//       item.longitude = item.lon;
//       item.showBillboard = true;
//       item.type = item.disasterType;
//       item.className = "district";
//       const entity = createPoint(item);
//       entity.show = false;
//       list.push(entity);
//     });
    treeMap.set("孙胡沟隐患点", list);
  }
});
//     treeMap.set("孙胡沟隐患点", list);
//   }
// });
let divPointList = [];
/**