| | |
| | | watch( |
| | | () => props.selectedScheme, |
| | | (newScheme) => { |
| | | console.log(newScheme, "弹窗的数据"); |
| | | // console.log(newScheme, "弹窗的数据"); |
| | | |
| | | // 检查数据有效性 |
| | | if (!newScheme || typeof newScheme !== "object") { |
| | |
| | | */ |
| | | function toggleLayerVisible(name, checked) { |
| | | const entityList = treeMap.get(name); |
| | | |
| | | console.log(`Toggling visibility for ${name}:`, checked); |
| | | |
| | | if (Array.isArray(entityList)) { |
| | | entityList.forEach((entity) => { |
| | | console.log(`Setting entity show to:`, checked); |
| | | entity.show = checked; |
| | | }); |
| | | } else if (entityList && typeof entityList.show !== "undefined") { |
| | | console.log(`Setting layer show to:`, checked); |
| | | entityList.show = checked; |
| | | } else { |
| | | console.error(`无法设置图层 ${name} 的可见性`); |
| | |
| | | */ |
| | | const getDevicetList = async () => { |
| | | await getDevicetListData().then((res) => { |
| | | console.log(res.data, "devicetList.value2"); |
| | | devicetList.value = res.data; |
| | | }); |
| | | }; |
| | |
| | | watch( |
| | | () => props.mesData, |
| | | (newMesData) => { |
| | | console.log(newMesData, '弹窗的数据'); |
| | | // console.log(newMesData, '弹窗的数据'); |
| | | |
| | | // 检查数据有效性 |
| | | if (!newMesData || typeof newMesData !== "object") { |
| | |
| | | // 获取 GeoJSON 中的第一个 Polygon feature |
| | | return dataSourcePromise.then(function (dataSource) { |
| | | viewer.dataSources.add(dataSource) |
| | | console.log("dataSource", dataSource) |
| | | // console.log("dataSource", dataSource) |
| | | // 获取 GeoJSON 中的第一个 Polygon feature |
| | | areaDataSource.push(dataSource) |
| | | |
| | |
| | | // return areaPrimitive |
| | | |
| | | const polygonEntity = dataSource.entities.values |
| | | console.log("polygonEntity", polygonEntity) |
| | | // console.log("polygonEntity", polygonEntity) |
| | | const distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1000, 50000000) |
| | | polygonEntity.forEach(entity => { |
| | | // console.log("entity", entity) |
| | |
| | | dataSource.name = name |
| | | // viewer.dataSources.add(dataSource) |
| | | // 获取 GeoJSON 中的第一个 Polygon feature |
| | | console.log("dataSource", dataSource) |
| | | // console.log("dataSource", dataSource) |
| | | |
| | | const polygonEntity = dataSource.entities.values |
| | | areaLineEntities.push(...polygonEntity) |
| | |
| | | // 获取 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); |
| | |
| | | } |
| | | |
| | | 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); // 设置填充颜色 |
| | |
| | | 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); |
| | | }); |
| | | } |
| | | |
| | |
| | | return dataSourcePromise.then(function (dataSource) { |
| | | viewer.dataSources.add(dataSource) |
| | | const polygonEntity = dataSource.entities.values |
| | | console.log("polygonEntity", polygonEntity) |
| | | // console.log("polygonEntity", polygonEntity) |
| | | const distanceDisplayCondition = new Cesium.DistanceDisplayCondition(1000, 50000000) |
| | | polygonEntity.forEach(entity => { |
| | | // console.log("entity", entity) |
| | |
| | | getSimData() //测试tr后端 |
| | | try { |
| | | const wktResult = convertToWKT(multiPolygonCoordinates); |
| | | console.log(wktResult,'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'); |
| | | // console.log(wktResult,'a'); |
| | | // 输出: MULTIPOLYGON(((120.123456 30.654321,120.234567 30.765432,120.345678 30.876543,120.123456 30.654321))) |
| | | } catch (error) { |
| | | console.error(error.message); |
| | |
| | | // 添加事件监听器,接收来自表格组件的事件 |
| | | function setupRowClickListener(dataSources) { |
| | | if (!Array.isArray(dataSources) || dataSources.length === 0) { |
| | | console.error("Data sources array is undefined or empty!"); |
| | | return; |
| | | } |
| | | EventBus.on("row-clicked", (id) => { |
| | |
| | | // 根据ID查找实体 |
| | | function findEntityById(id, dataSources) { |
| | | if (!Array.isArray(dataSources) || dataSources.length === 0) { |
| | | console.error("Data sources array is undefined or empty!"); |
| | | return null; |
| | | } |
| | | console.log("Searching for ID:", id); |