| | |
| | | }); |
| | | }); |
| | | focusOnAllFeatures(); |
| | | if (activeName.value !== '国土空间规划') { |
| | | viewInstance.value?.addLeftClickEvent(null, handleFenceClick); |
| | | } |
| | | viewInstance.value?.addLeftClickEvent(null, handleFenceClick); |
| | | |
| | | }; |
| | | //计算所有图斑的包围球并定位 |
| | | const focusOnAllFeatures = () => { |
| | |
| | | if (Cesium.defined(pickedObject) && pickedObject.id?.customType === 'fence_polygon') { |
| | | const selectedEntity = pickedObject.id; |
| | | const selectedData = selectedEntity.customInfo; |
| | | viewer.entities.values.forEach(entity => { |
| | | if (entity.customType === 'fence_polygon') { |
| | | entity.polygon.material = entity === selectedEntity |
| | | ? Cesium.Color.RED.withAlpha(0.5) |
| | | : Cesium.Color.YELLOW.withAlpha(0.5); |
| | | } |
| | | }); |
| | | |
| | | layerParams.value.editNest = true; // 显示右侧编辑组件 |
| | | // viewer.entities.values.forEach(entity => { |
| | | // if (entity.customType === 'fence_polygon') { |
| | | // entity.polygon.material = entity === selectedEntity |
| | | // ? Cesium.Color.RED.withAlpha(0.5) |
| | | // : Cesium.Color.YELLOW.withAlpha(0.5); |
| | | // } |
| | | // }); |
| | | if (activeName.value !== '国土空间规划') { |
| | | layerParams.value.editNest = true; // 显示右侧编辑组件 |
| | | layerParams.value.decideWhetherToAddOrEdit = 2; // 标记为编辑模式 |
| | | // 根据围栏类型设置fenceType |
| | | if (activeName.value === '电子围栏') { |
| | |
| | | layerParams.value.fenceArea = selectedData.area; |
| | | layerParams.value.editingIsProhibited = true |
| | | } |
| | | } |
| | | |
| | | }; |
| | | let publicCesiumInstance = null; |
| | | let viewer = null; |