| | |
| | | @update:editFolder="handleFolder" |
| | | :activeName="activeName" |
| | | @newFencesMethods="newFencesMethods" |
| | | :reset-check="resetCheck" |
| | | :reset-check="resetCheck" |
| | | ></leftList> |
| | | <rightEdit |
| | | v-if="layerParams.addNest || layerParams.editNest" |
| | |
| | | import * as Cesium from 'cesium'; |
| | | import { PublicCesium } from '@/utils/cesium/publicCesium'; |
| | | import _, { cloneDeep, throttle } from 'lodash'; |
| | | |
| | | const isProd = import.meta.env.VITE_APP_ENV === 'production' |
| | | import { provide } from 'vue'; |
| | | import { useStore } from 'vuex'; |
| | | const isProd = import.meta.env.VITE_APP_ENV === 'production' |
| | |
| | | layerParams.value.addFolder = false |
| | | layerParams.value.editFolder = false |
| | | resetCheck.value = !resetCheck.value; |
| | | |
| | | |
| | | }; |
| | | const refreshMethod = () => { |
| | | getdataFolderApi(); |
| | |
| | | viewer.entities.removeAll(); |
| | | layerParams.value.editDetailData = val; |
| | | drawPolygonExample.editThePatch(true); |
| | | drawPolygonExample.drawTheArea(true); |
| | | drawPolygonExample.drawTheArea(true); |
| | | let geoDataArr = JSON.parse(val.geo_data); |
| | | if (geoDataArr.length > 0) { |
| | | geoDataArr.pop(); |
| | |
| | | console.warn(`数据 ${item.name} 坐标点不足,无法绘制`); |
| | | return; |
| | | } |
| | | |
| | | |
| | | tbJwdList.push(...positions); |
| | | let degreesArray = []; |
| | | positions.forEach(pos => { |
| | |
| | | border2: Cesium.Color.fromCssColorString('#ff0000'), |
| | | border3: Cesium.Color.fromCssColorString('#00ffea'), |
| | | }; |
| | | const fillColor = item.category_id === 1 |
| | | ? colorMap[1] |
| | | : item.category_id === 2 |
| | | ? colorMap[2] |
| | | : item.category_id === 3 |
| | | ? colorMap[3] |
| | | const fillColor = item.category_id === 1 |
| | | ? colorMap[1] |
| | | : item.category_id === 2 |
| | | ? colorMap[2] |
| | | : item.category_id === 3 |
| | | ? colorMap[3] |
| | | : Cesium.Color.YELLOW.withAlpha(0.5); |
| | | |
| | | const borderColor = item.category_id === 1 |
| | | ? colorMap.border1 |
| | | : item.category_id === 2 |
| | | ? colorMap.border2 |
| | | : item.category_id === 3 |
| | | ? colorMap.border3 |
| | | |
| | | const borderColor = item.category_id === 1 |
| | | ? colorMap.border1 |
| | | : item.category_id === 2 |
| | | ? colorMap.border2 |
| | | : item.category_id === 3 |
| | | ? colorMap.border3 |
| | | : Cesium.Color.YELLOW; |
| | | viewer.entities.add({ |
| | | id: `polygon_${item.id}`, |
| | |
| | | material:borderColor, |
| | | clampToGround: true, |
| | | }, |
| | | zIndex: 99, |
| | | zIndex: 99, |
| | | }); |
| | | }); |
| | | }); |
| | | if (!layerParams.value.isSingleLocating) { |
| | | focusOnAllFeatures(); |
| | | focusOnAllFeatures(); |
| | | } |
| | | viewInstance.value?.addLeftClickEvent(null, handleFenceClick); |
| | | }; |
| | | const focusOnAllFeatures = () => { |
| | | if (tbJwdList.length === 0 || !viewer) return; |
| | | |
| | | |
| | | // 判断是否有指定定位的文件夹 |
| | | if (layerParams.value.currentLocationFolderId) { |
| | | // 筛选当前文件夹下的所有子节点坐标 |
| | |
| | | const positions = parseGeoDataToPositions(item.geo_data, item.altitude); |
| | | return positions.length >= 3 ? positions : []; |
| | | }); |
| | | |
| | | |
| | | if (targetFolderPositions.length > 0) { |
| | | const positionsData = targetFolderPositions.map(pos => [ |
| | | pos.lng, |
| | |
| | | const handleFenceClick = movement => { |
| | | if (!viewer) return; |
| | | layerParams.value.editDetailData = null; |
| | | |
| | | |
| | | if(activeName.value !== '国土空间规划') { |
| | | const pickedObjects = viewer.scene.drillPick(movement.position, 10); |
| | | const pickedObjects = viewer.scene.drillPick(movement.position, 10); |
| | | // 遍历所有被点击的实体,找到围栏类型(customType: 'fence_polygon') |
| | | let selectedEntity = null; |
| | | for (let i = 0; i < pickedObjects.length; i++) { |
| | | const pick = pickedObjects[i]; |
| | | if (Cesium.defined(pick.id) && pick.id?.customType === 'fence_polygon') { |
| | | selectedEntity = pick.id; |
| | | break; |
| | | break; |
| | | } |
| | | } |
| | | // viewer.entities.values.forEach(entity => { |
| | |
| | | let cartographic = Cesium.Cartographic.fromCartesian(item); |
| | | let lng = Cesium.Math.toDegrees(cartographic.longitude); // 经度 |
| | | let lat = Cesium.Math.toDegrees(cartographic.latitude); // 纬度 |
| | | let height = Cesium.Math.toDegrees(cartographic.height); //高度 |
| | | let height = Cesium.Math.toDegrees(cartographic.height); //高度 |
| | | return { |
| | | lng: _.round(lng, 6), |
| | | lat: _.round(lat, 6), |
| | |
| | | }else { |
| | | showToolTipText.value = '点击地图生成测绘区域' |
| | | } |
| | | |
| | | |
| | | if(polygon.length > 0){ |
| | | polygon.push([curPolygonPosition[0]?.lng, curPolygonPosition[0]?.lat]) |
| | | } |
| | |
| | | // 添加loading |
| | | const isPageLoading = ref(false); |
| | | const handleLoadingChange = (status) => { |
| | | isPageLoading.value = status; |
| | | isPageLoading.value = status; |
| | | }; |
| | | provide('layerParams', layerParams); |
| | | onMounted(() => { |