From d0272e6a4e5b68c4e82e7356849f6ceb402a1055 Mon Sep 17 00:00:00 2001 From: guonan <guonan201020@163.com> Date: 星期五, 18 四月 2025 20:02:55 +0800 Subject: [PATCH] 修改避险点 --- src/views/mnfz.vue | 18 +++++++++++------- 1 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/views/mnfz.vue b/src/views/mnfz.vue index 2300f8f..c92927c 100644 --- a/src/views/mnfz.vue +++ b/src/views/mnfz.vue @@ -59,15 +59,19 @@ const MaxInfluenceAreaList = ref([]); const dataSources = []; function getTimeMarkers() { - // 灏嗘敼 list鏁版嵁鐨� gemo EPSG:4548 鍧愭爣 杞负 wgs84 鍧愭爣绯荤殑 geojson 鏁版嵁 + // 灏� list 鏁版嵁鐨� geom EPSG:4548 鍧愭爣杞崲涓� WGS84 鍧愭爣绯荤殑 GeoJSON 鏁版嵁 const list = MaxInfluenceAreaList.value; list.forEach((item, index) => { - const geosjon = geomToGeoJSON(item.geom); - Cesium.GeoJsonDataSource.load(geosjon, { - stroke: Cesium.Color.RED, // 杈规棰滆壊 - strokeWidth: 2, // 杈规瀹藉害 - fill: Cesium.Color.RED.withAlpha(0.5), // 濉厖棰滆壊锛堝甫閫忔槑搴︼級 - }).then((dataSource) => { + const geojson = geomToGeoJSON(item.geom); + Cesium.GeoJsonDataSource.load(geojson).then((dataSource) => { + // 璁剧疆鏍峰紡锛屽皢棰滆壊鏀逛负绾㈣壊 + dataSource.entities.values.forEach((entity) => { + entity.polygon.material = new Cesium.Color(1.0, 0.0, 0.0, 0.6); // 绾㈣壊锛�80% 涓嶉�忔槑搴� + entity.polygon.outlineColor = Cesium.Color.YELLOW; // 璁剧疆杞粨棰滆壊涓虹孩鑹诧紙濡傛灉闇�瑕侊級 + entity.polygon.outline = true; // 鏄剧ず杞粨锛堝鏋滈渶瑕侊級 + }); + + // 娣诲姞鏁版嵁婧愬埌 viewer viewer.dataSources.add(dataSource); dataSources.push(dataSource); }); -- Gitblit v1.9.3