| | |
| | | editFolderData: null, |
| | | editingIsProhibited: false, //禁止编辑 |
| | | isDetailShow: false, |
| | | isSingleLocating:false |
| | | isSingleLocating:false , |
| | | currentLocationFolderId:null, |
| | | }); |
| | | |
| | | const handleClick = tab => { |
| | |
| | | }; |
| | | // 点击显示区域 |
| | | const handleCoverDataUpdate = data => { |
| | | console.log('daa',data); |
| | | |
| | | selectDataList.value = data; |
| | | if (selectDataList.value.length > 0) { |
| | | |
| | |
| | | }); |
| | | }); |
| | | |
| | | console.log('layerParams.value.isSingleLocating',layerParams.value.isSingleLocating); |
| | | |
| | | if (!layerParams.value.isSingleLocating) { |
| | | focusOnAllFeatures(); |
| | |
| | | }; |
| | | const focusOnAllFeatures = () => { |
| | | if (tbJwdList.length === 0 || !viewer) return; |
| | | |
| | | // 判断是否有指定定位的文件夹 |
| | | if (layerParams.value.currentLocationFolderId) { |
| | | console.log('11111111'); |
| | | |
| | | // 筛选当前文件夹下的所有子节点坐标 |
| | | const targetFolderPositions = selectDataList.value |
| | | .filter(item => item.folder_id === layerParams.value.currentLocationFolderId) |
| | | .flatMap(item => { |
| | | const positions = parseGeoDataToPositions(item.geo_data, item.altitude); |
| | | return positions.length >= 3 ? positions : []; |
| | | }); |
| | | |
| | | if (targetFolderPositions.length > 0) { |
| | | const positionsData = targetFolderPositions.map(pos => [ |
| | | pos.lng, |
| | | pos.lat, |
| | | pos.height || 0 |
| | | ]); |
| | | flyVisual({ |
| | | positionsData, |
| | | viewer, |
| | | multiple: activeName.value === '国土空间规划' ? 13 : 10, |
| | | pitch: -90 |
| | | }); |
| | | return; // 仅聚焦当前文件夹,结束方法 |
| | | } |
| | | } |
| | | console.log('333333'); |
| | | // 无指定文件夹时,聚焦所有选中数据(保持原有逻辑) |
| | | const positionsData = tbJwdList.map(pos => [ |
| | | pos.lng, |
| | | pos.lat, |
| | | pos.height || 0 |
| | | pos.height || 0 |
| | | ]); |
| | | flyVisual({ |
| | | positionsData, |
| | | viewer, |
| | | multiple:activeName.value == '国土空间规划' ? 13 :4, // 缩放倍数 |
| | | pitch: -90 |
| | | multiple: activeName.value === '国土空间规划' ? 13 : 4, |
| | | pitch: -90 |
| | | }); |
| | | }; |
| | | // 区域点击显示详细信息 |
| | |
| | | } |
| | | }; |
| | | provide('layerParams', layerParams); |
| | | // onMounted(() => { |
| | | // initMap(); |
| | | // cesiumContextMenu(); |
| | | // getdataFolderApi(); |
| | | // EventBus.on('deleteMapEntityById', deleteMapEntityById); |
| | | // EventBus.on('deleteMapEntitiesByFolderId', deleteMapEntitiesByFolderId); |
| | | |
| | | // }); |
| | | onMounted(() => { |
| | | initMap(); |
| | | cesiumContextMenu(); |
| | |
| | | }); |
| | | |
| | | //定位到指定节点 |
| | | const focusOnNode = (nodeData) => { |
| | | // const focusOnNode = (nodeData) => { |
| | | // if (!viewer || !nodeData?.geo_data) return; |
| | | |
| | | // // 解析节点坐标 |
| | | // const positions = parseGeoDataToPositions(nodeData.geo_data, nodeData.altitude); |
| | | // if (positions.length < 3) { |
| | | |
| | | // return; |
| | | // } |
| | | // flyVisual({ |
| | | // positionsData: positions.map(pos => [pos.lng, pos.lat, pos.height || 0]), |
| | | // viewer, |
| | | // multiple:activeName.value == '国土空间规划' ? 13 :7, // 缩放倍数 |
| | | // pitch: -90 |
| | | // }); |
| | | |
| | | // }; |
| | | // 父组件中修改 focusOnNode 方法 |
| | | const focusOnNode = (nodeData) => { |
| | | if (!viewer || !nodeData?.geo_data) return; |
| | | |
| | | // 解析节点坐标 |
| | | const positions = parseGeoDataToPositions(nodeData.geo_data, nodeData.altitude); |
| | | if (positions.length < 3) { |
| | | |
| | | return; |
| | | } |
| | | flyVisual({ |
| | | positionsData: positions.map(pos => [pos.lng, pos.lat, pos.height || 0]), |
| | | viewer, |
| | | multiple:activeName.value == '国土空间规划' ? 13 :7, // 缩放倍数 |
| | | pitch: -90 |
| | | }); |
| | | if (positions.length < 3) return; |
| | | |
| | | // level 2 节点走全量聚焦,level 3 节点走单个聚焦 |
| | | if (nodeData.level === 2) { |
| | | focusOnAllFeatures(); |
| | | } else { |
| | | flyVisual({ |
| | | positionsData: positions.map(pos => [pos.lng, pos.lat, pos.height || 0]), |
| | | viewer, |
| | | multiple: activeName.value === '国土空间规划' ? 13 : 7, // 缩放倍数 |
| | | pitch: -90 |
| | | }); |
| | | } |
| | | }; |
| | | onBeforeUnmount(() => { |
| | | destroyMap(); |