wangjuncheng
2025-04-23 8a368655576fd4eb3f517610aa8b30d633f1ea84
src/utils/area_all.js
@@ -16,11 +16,11 @@
    // 获取 GeoJSON 中的 Polygon feature
    return dataSourcePromise.then(function (dataSource) {
        viewer.dataSources.add(dataSource);
        console.log("GeoJSON data loaded:", dataSource);
        // console.log("GeoJSON data loaded:", dataSource);
        areaDataSource.push(dataSource);
        const polygonEntity = dataSource.entities.values;
        console.log("Entities in dataSource:", polygonEntity);
        // console.log("Entities in dataSource:", polygonEntity);
        // 初始化效果
        applyPolygonEffects(polygonEntity, color);
@@ -33,7 +33,7 @@
}
function applyPolygonEffects(entities, color) {
    console.log("Applying polygon effects...");
    // console.log("Applying polygon effects...");
    entities.forEach(entity => {
        entity.polygon.heightReference = Cesium.HeightReference.NONE;
        entity.polygon.material = new Cesium.ColorMaterialProperty(color); // 设置填充颜色
@@ -44,7 +44,7 @@
        if (!viewer.entities.getById(entity.id)) {
            viewer.entities.add(entity);
        }
        console.log("Effect applied to entity:", entity.id);
        // console.log("Effect applied to entity:", entity.id);
    });
}