| | |
| | | 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); |
| | | }); |