Browse Source

功能修改20250326-03

zhiyuan-007 6 days ago
parent
commit
889525646d

+ 3 - 3
src/components/MapView.vue

@@ -7,7 +7,7 @@
 <script>
 import useLayoutStore from '@/store/layout'
 import { useMapStore } from '@/store/map.js'
-import { AddYaoganMapLayer, importantAreaPosition } from '@/utils/map/addLayer.js'
+import { AddBaseMapLayer, importantAreaPosition } from '@/utils/map/addLayer.js'
 import CityGis from '@/utils/map/CityGis.Bridge.js'
 import { myBridge } from '@/utils/map/map.js'
 import { onMounted } from 'vue'
@@ -31,8 +31,8 @@ export default {
 					console.log('地图创建完成')
 				},
 			})
-			AddYaoganMapLayer()
-			importantAreaPosition(4190, -5273, 19419, 6, 34)
+			AddBaseMapLayer()
+			importantAreaPosition(1990, -1185, 1412, 13, 54)
 			bridge.addEventListener((arg) => {
 				// console.log('map listener:',arg)
 				switch (arg.action) {

+ 176 - 0
src/data/MoveCar.json

@@ -0,0 +1,176 @@
+{
+  "paths1": [
+    [
+      2793.864599595192,
+      901.658704419662,
+      0
+    ],
+    [
+      2793.6509009229326,
+      901.0123508696659,
+      100
+    ],
+    [
+      2798.557835382849,
+      960.97592212866,
+      100
+    ],
+    [
+      2847.499187535616,
+      1003.583154753295,
+      100
+    ],
+    [
+      2912.552128329501,
+      1039.626331293216,
+      99.99999999906868
+    ],
+    [
+      3071.1961524066214,
+      1107.577257156012,
+      100.00000000209548
+    ],
+    [
+      3278.347727182615,
+      1176.6387484848105,
+      99.99999999860302
+    ],
+    [
+      3400.2541650048834,
+      1200.4015748868385,
+      100.00000000093132
+    ],
+    [
+      3481.377674740545,
+      1212.9278557111718,
+      99.99999999720603
+    ],
+    [
+      3572.9939249743356,
+      1214.6717122521584,
+      100.00000000279397
+    ],
+    [
+      3662.1252360307035,
+      1229.9645778602462,
+      100
+    ],
+    [
+      3749.04097395513,
+      1229.9309347879573,
+      100.00000000093132
+    ],
+    [
+      3823.7009391081147,
+      1221.990974433195,
+      99.99999999906868
+    ],
+    [
+      3899.681462008697,
+      1225.7976213664222,
+      99.99999999813735
+    ],
+    [
+      4059.050414990652,
+      1171.4603758058506,
+      99.99999999906868
+    ],
+    [
+      4029.8655992358576,
+      1097.8677174668455,
+      100
+    ],
+    [
+      4028.35425303478,
+      1099.2525115894166,
+      0
+    ]
+  ],
+  "paths2": [
+    [
+      1402.1217227804018,
+      348.37421585662935,
+      2.7939677238464355e-9
+    ],
+    [
+      1401.9080241081424,
+      347.72786230663326,
+      100.00000000279397
+    ],
+    [
+      1418.0720522801462,
+      411.97922736945713,
+      100.00000000186265
+    ],
+    [
+      1455.7563107208257,
+      450.29866619026245,
+      100.00000000279397
+    ],
+    [
+      1520.809251514711,
+      486.34184273018343,
+      100.00000000186265
+    ],
+    [
+      1679.4532755918312,
+      554.2927685929793,
+      100.00000000488944
+    ],
+    [
+      1886.6048503678248,
+      623.3542599217783,
+      100.00000000139698
+    ],
+    [
+      2008.5112881900932,
+      647.1170863238062,
+      100.00000000372529
+    ],
+    [
+      2089.634797925755,
+      659.6433671481394,
+      100
+    ],
+    [
+      2181.251048159546,
+      661.387223689126,
+      100.00000000558794
+    ],
+    [
+      2270.3823592159138,
+      676.6800892972137,
+      100.00000000279397
+    ],
+    [
+      2357.29809714034,
+      676.6464462249247,
+      100.00000000372529
+    ],
+    [
+      2431.958062293325,
+      668.7064858701631,
+      100.00000000186265
+    ],
+    [
+      2507.9385851939073,
+      672.5131328033896,
+      100.00000000093132
+    ],
+    [
+      2667.307538175862,
+      618.1758872428185,
+      100.00000000186265
+    ],
+    [
+      2638.1227224210675,
+      544.5832289038129,
+      100.00000000279397
+    ],
+    [
+      2636.61137621999,
+      545.968023026384,
+      2.7939677238464355e-9
+    ]
+  ]
+}

+ 1 - 93
src/data/resources.json

@@ -1,109 +1,17 @@
 [
-  {
-    "title": "公园绿地",
-    "D_CODE": "D09010103201506",
-    "id": "D0901010320150601",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D0901010320150601",
-    "visible": false,
-    "opacity": 1,
-    "type": "dynamic"
-  },
   {
     "title": "全市白模",
     "D_CODE": "D85030103202409",
     "id": "D8503010320240901",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/05195418",
     "visible": false,
     "opacity": 1,
     "type": "scene"
   },
-  {
-    "title": "快速路",
-    "D_CODE": "D70020004201506",
-    "id": "D7002000420150601",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990120250113",
-    "visible": false,
-    "opacity": 1,
-    "type": "tile"
-  },
-  {
-    "title": "高速公路",
-    "D_CODE": "D70020003201506",
-    "id": "D7002000320150601",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990220250113",
-    "visible": false,
-    "opacity": 1,
-    "type": "tile"
-  },
-  {
-    "title": "地面道路",
-    "D_CODE": "D70020002201506",
-    "id": "D7002000220150601",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990320250113",
-    "visible": false,
-    "opacity": 1,
-    "type": "tile"
-  },
-  {
-    "title": "全市河流",
-    "D_CODE": "D04010101201506",
-    "id": "D0401010120150601",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990120250111",
-    "visible": false,
-    "opacity": 1,
-    "type": "tile"
-  },
-  {
-    "title": "五角场精模",
-    "D_CODE": "D9999990120241225",
-    "id": "D9999990120241225",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990120241225",
-    "visible": false,
-    "opacity": 1,
-    "type": "scene"
-  },
-  {
-    "title": "医院",
-    "D_CODE": "D9999990120250108",
-    "id": "D9999990120250108",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990120250108",
-    "visible": false,
-    "opacity": 1,
-    "type": "dynamic"
-  },
-  {
-    "title": "人口",
-    "D_CODE": "D9999990220250108",
-    "id": "D9999990220250108",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9999990220250108",
-    "visible": false,
-    "opacity": 1,
-    "type": "feature"
-  },
-
   {
     "title": "影像底图",
     "D_CODE": "50115036",
     "id": "50115036",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/50115036",
-    "visible": false,
-    "opacity": 1,
-    "type": "tile"
-  },
-  {
-    "title": "政务底图",
-    "D_CODE": "37072265",
-    "id": "37072265",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265",
-    "visible": false,
-    "opacity": 1,
-    "type": "tile"
-  },
-  {
-    "title": "暗色底图",
-    "D_CODE": "93493321",
-    "id": "93493321",
-    "url": "https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321",
+    "url": "",
     "visible": false,
     "opacity": 1,
     "type": "tile"

+ 19 - 195
src/utils/map/addLayer.js

@@ -49,60 +49,32 @@ export function importantAreaPosition(x, y, z, heading, tilt, isfly = true) {
 	})
 }
 
-export async function AddBaseMapLayer() {
-	let url = await returnProxyUrl('https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/93493321')
-	invokeParams('AddBaseMapLayer', {
+export function AddBaseMapLayer() {
+	invokeParams('AddBaseMapAnSeLayer', {
 		id: 'BaseMap',
 		title: 'BaseMap',
 		visible: true,
 		opacity: 1,
-		url,
 	})
-	invokeParams('AddSingleLayer', {
-		id: 'BaseMapCSJYaoGan',
-		visible: false,
-	})
-	showLayersWithScaleEvents({ status: 'hide' })
 }
 
-export async function AddZhenwuMapLayer() {
-	let url = await returnProxyUrl('https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/37072265')
-	invokeParams('AddBaseMapLayer', {
-		id: 'BaseMapZhenwu',
-		title: 'BaseMapZhenwu',
+export function AddZhenwuMapLayer() {
+	invokeParams('AddBaseMapSuSeLayer', {
+		id: 'BaseMap',
+		title: 'BaseMap',
 		visible: true,
 		opacity: 1,
-		url,
-	})
-	invokeParams('AddSingleLayer', {
-		id: 'BaseMapCSJYaoGan',
-		visible: false,
 	})
-	showLayersWithScaleEvents({ status: 'hide' })
 }
 
-export async function AddYaoganMapLayer() {
-	let url = await returnProxyUrl('https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/ptgl/50115036')
-	invokeParams('AddBaseMapLayer', {
-		id: 'BaseMapYaoGan',
-		title: 'BaseMapYaoGan',
-		visible: true,
-		opacity: 1,
+export function AddYaoganMapLayer(visible) {
+	invokeParams('AddYaoGanLayer', {
+		id: 'YaoGan',
+		title: 'YaoGan',
 		type: 'tile',
-		url,
-	})
-	let CSJUrl = await returnProxyUrl(
-		'https://cimweb.zjw.sh.cegn.cn:2008/MapProxyApi/getSceneServer/gxjh_fwjk/D9902002720240801'
-	)
-	invokeParams('AddSingleLayer', {
-		id: 'BaseMapCSJYaoGan',
-		title: 'BaseMapCSJYaoGan',
-		visible: true,
+		visible: visible,
 		opacity: 1,
-		type: 'tile',
-		url: CSJUrl,
 	})
-	showLayersWithScaleEvents({ status: 'show' })
 }
 
 export function showLayersWithScaleEvents(params) {
@@ -123,164 +95,16 @@ export async function heatMap(params) {
 }
 
 export async function AddSingleLayer(params) {
-	// if(params.token){
-	//     params.url = "https://cimweb.zjw.sh.cegn.cn:2008/MapServiceProxy/" + params.token;
-	// }
-	params.url = await returnProxyUrl(params.url)
-	let wkid = '0' // 0 代表上海城建 1:代表3857
-	if (params.wkid) {
-		if (params.type == '动态地图' && params.wkid == '1') {
-			params.type = 'dynamic'
-		}
-		if (params.type == '切片地图' && params.wkid == '1') {
-			params.type = 'tile'
-		}
+	if (params.title == '影像底图') {
+		AddYaoganMapLayer(params.visible)
 	}
-	if (params.type == 'scene' || params.type == '3DObject') {
-		if (params.title == '全市白模') {
-			invokeParams('AddSingleLayer', {
-				id: params.id,
-				title: params.title,
-				visible: params.visible,
-				opacity: 0.8,
-				url: params.url + '/SceneServer',
-				where: 'objectid not in  (3941595,3841426)',
-				type: 'scene',
-				theme: '高度',
-				popupEnabled: false,
-				elevationInfo: {
-					//下沉高度
-					mode: 'absolute-height',
-					offset: -3.5,
-				},
-				renderer: {
-					type: 'simple',
-					symbol: {
-						type: 'mesh-3d',
-						symbolLayers: [
-							{
-								type: 'fill',
-								material: {
-									//color: [102, 167, 219, 0.9],
-									color: [255, 255, 255, 0.9],
-									colorMixMode: 'replace',
-								},
-							},
-						],
-					},
-				},
-				mapID: params.mapID,
-			})
-		} else {
-			invokeParams('AddSingleLayer', {
-				id: params.id,
-				title: params.title,
-				visible: params.visible,
-				opacity: params.opacity,
-				url: params.url + '/SceneServer',
-				type: 'scene',
-				popupEnabled: false,
-				mapID: params.mapID,
-			})
-		}
-	} else if (params.type == 'bim') {
-		switch (params.title) {
-			case '朱家角车站':
-				invokeParams('AddSingleLayer', {
-					id: params.id,
-					title: params.title,
-					visible: params.visible,
-					opacity: params.opacity === undefined ? 1 : params.opacity,
-					url: params.url,
-					elevationInfo: {
-						//下沉高度
-						mode: 'absolute-height',
-						offset: -19.5,
-					},
-					type: 'building',
-					mapID: params.mapID,
-				})
-				break
-			default:
-				invokeParams('AddSingleLayer', {
-					id: params.id,
-					title: params.title,
-					visible: params.visible,
-					opacity: params.opacity === undefined ? 1 : params.opacity,
-					url: params.url,
-					elevationInfo: {
-						//下沉高度
-						mode: 'absolute-height',
-						offset: -19.5,
-					},
-					type: 'building',
-					mapID: params.mapID,
-				})
-				break
-		}
-	} else if (params.type == 'mesh') {
-		invokeParams('AddSingleLayer', {
-			id: params.id,
-			title: params.title,
-			visible: params.visible,
-			opacity: params.opacity === undefined ? 1 : params.opacity,
-			url: params.url,
-			//"renderer":locationRenderer,
-			type: 'mesh',
-			mapID: params.mapID,
-		})
-		return
-	} else if (params.type == 'dynamic') {
-		invokeParams('AddSingleLayer', {
-			id: params.id,
-			title: params.title,
-			visible: params.visible,
-			opacity: params.opacity === undefined ? 1 : params.opacity,
-			url: params.url,
-			// "sublayers": [
-			//     {
-			//         "id": 0
-			//     },{
-			//         "id": 1
-			//     }
-			// ],
-			type: 'dynamic',
-			mapID: params.mapID,
-		})
-	} else if (params.type == 'tile') {
-		invokeParams('AddSingleLayer', {
-			id: params.id,
-			title: params.title,
-			visible: params.visible,
-			opacity: params.opacity === undefined ? 1 : params.opacity,
-			url: params.url,
-			type: 'tile',
-			mapID: params.mapID,
-		})
-	} else if (params.type == '动态地图') {
-		invokeParams('AddSingleLayer', {
-			id: params.id,
-			title: params.title,
-			visible: params.visible,
-			opacity: params.opacity === undefined ? 1 : params.opacity,
-			url: params.url,
-			type: 'shc_map',
-			mapID: params.mapID,
-		})
-	} else if (params.type == '切片地图') {
-		let size = [256, 256]
-		let origin = {
-			x: -9080400.0,
-			y: 10002300,
-		}
-		invokeParams('AddSingleLayer', {
-			id: params.id,
-			title: params.title,
+	if (params.title == '全市白模') {
+		invokeParams('AddWhiteMoldLayer', {
+			id: 'WhiteMold',
+			title: 'WhiteMold',
+			type: 'scene',
 			visible: params.visible,
-			opacity: params.opacity === undefined ? 1 : params.opacity,
-			url: params.url,
-			type: 'shc_tile',
-			mapID: params.mapID,
+			opacity: 1,
 		})
 	}
 }

+ 26 - 1
src/utils/map/addTool.js

@@ -1,6 +1,6 @@
 import { myBridge, previewMapBridge } from './map.js'
 import { getMapToken, getServiceToken } from '@/service/map.js'
-
+import MoveCar from '../../../src/data/MoveCar.json'
 export function invokeParams(ActionName, params) {
 	console.log('invokeParams', ActionName, params)
 	getMapToken().then((res) => {
@@ -109,8 +109,33 @@ export async function getPathCube24(params) {
 //查询态势
 export async function getFixedFlyPoint(params) {
 	invokeParams('GetFixedFlyPoint', {
+		id: 'wrj1',
 		status: params.status ? 'show' : 'hide',
+		paths: MoveCar.paths1,
+	})
+	invokeParams('GetFixedFlyPoint', {
+		id: 'wrj2',
+		status: params.status ? 'show' : 'hide',
+		paths: MoveCar.paths2,
 	})
 }
 
 //模拟无人机飞行
+export async function PathPipe(params) {
+	invokeParams('PathPipe', {
+		id: 'wrj1',
+		status: params.status ? 'show' : 'hide',
+		paths: [MoveCar.paths1],
+		color: '#438EDB',
+		intensity: 1.2,
+		pipeRadius: 10,
+	})
+	invokeParams('PathPipe', {
+		id: 'wrj2',
+		status: params.status ? 'show' : 'hide',
+		paths: [MoveCar.paths2],
+		color: '#438EDB',
+		intensity: 1.2,
+		pipeRadius: 10,
+	})
+}

+ 47 - 54
src/views/home/cpns/BaseMap.vue

@@ -1,79 +1,72 @@
 <template>
-  <ul class="base-map" @mouseleave="handleMouseMove('leave')" @mouseenter="handleMouseMove('enter')">
-    <li v-for="item in data" @click.stop="handleChange(item.id)">
-      <img :src="getAssetsFile('page/' + item.pic + (layoutStore.mapScene === item.id ? '-h.png' : '.png'))" alt="">
-      <span>{{ item.title }}</span>
-    </li>
-  </ul>
+	<ul class="base-map" @mouseleave="handleMouseMove('leave')" @mouseenter="handleMouseMove('enter')">
+		<li v-for="item in data" @click.stop="handleChange(item.id)">
+			<img :src="getAssetsFile('page/' + item.pic + (layoutStore.mapScene === item.id ? '-h.png' : '.png'))" alt="" />
+			<span>{{ item.title }}</span>
+		</li>
+	</ul>
 </template>
 
 <script setup>
-import { ref } from 'vue';
-import useLayoutStore from '@/store/layout';
-import { getAssetsFile } from '@/utils/require';
-import { AddBaseMapLayer, AddYaoganMapLayer, AddZhenwuMapLayer } from "@/utils/map/addLayer.js";
+import { ref } from 'vue'
+import useLayoutStore from '@/store/layout'
+import { getAssetsFile } from '@/utils/require'
+import { AddBaseMapLayer, AddZhenwuMapLayer } from '@/utils/map/addLayer.js'
 
 const layoutStore = useLayoutStore()
 
 const data = ref([
-  { id: 'rs', title: '遥感', pic: 'basemap-rs' },
-  { id: 'dark', title: '深色', pic: 'basemap-dark' },
-  { id: 'light', title: '浅色', pic: 'basemap-light' },
+	{ id: 'dark', title: '深色', pic: 'basemap-dark' },
+	{ id: 'light', title: '浅色', pic: 'basemap-light' },
 ])
 
 function handleChange(id) {
-  console.log(id, layoutStore.mapScene)
-  if (id === layoutStore.mapScene) return
-  layoutStore.setMapScene(id)
-  switch (id) {
-    case 'rs':
-      AddYaoganMapLayer()
-      break;
-    case 'dark':
-      AddBaseMapLayer()
-      break;
-    case 'light':
-      AddZhenwuMapLayer()
-      break;
-  }
+	console.log(id, layoutStore.mapScene)
+	if (id === layoutStore.mapScene) return
+	layoutStore.setMapScene(id)
+	switch (id) {
+		case 'dark':
+			AddBaseMapLayer()
+			break
+		case 'light':
+			AddZhenwuMapLayer()
+			break
+	}
 }
 
 const emit = defineEmits(['mouseMove'])
 
 function handleMouseMove(type) {
-  emit('mouseMove', type)
+	emit('mouseMove', type)
 }
-
 </script>
 
 <style lang="scss" scoped>
 .base-map {
-  display: flex;
-  flex-direction: column;
-
-  li {
-    position: relative;
-    width: 104px;
-    height: 104px;
-    margin-bottom: 5px;
-
-    img {
-      width: 100%;
-      height: 100%;
+	display: flex;
+	flex-direction: column;
 
-    }
+	li {
+		position: relative;
+		width: 104px;
+		height: 104px;
+		margin-bottom: 5px;
 
-    span {
-      display: block;
-      position: absolute;
-      bottom: 9px;
-      width: 100%;
-      line-height: 14px;
-      font-size: 14px;
-      text-align: center;
-      color: #fff;
-    }
+		img {
+			width: 100%;
+			height: 100%;
+		}
 
-  }
+		span {
+			display: block;
+			position: absolute;
+			bottom: 9px;
+			width: 100%;
+			line-height: 14px;
+			font-size: 14px;
+			text-align: center;
+			color: #fff;
+		}
+	}
 }
-</style>
+</style>

+ 1 - 5
src/views/home/cpns/PanelSjwg.vue

@@ -55,11 +55,7 @@ const basicList = ref([
 	{
 		label: '地形',
 		show: true,
-		children: [
-			{ label: '影像', alias: '影像底图', icon: 'dxing', active: false },
-			{ label: '政务底图', alias: '政务底图', icon: 'dxing', active: false },
-			{ label: '暗色底图', alias: '暗色底图', icon: 'dxing', active: false },
-		],
+		children: [{ label: '影像', alias: '影像底图', icon: 'dxing', active: false }],
 	},
 	{
 		label: '低空障碍物',

+ 2 - 1
src/views/home/cpns/ToolList.vue

@@ -37,7 +37,7 @@ import { onBeforeMount, ref, watch } from 'vue'
 import { getAssetsFile } from '@/utils/require'
 import useLayoutStore from '@/store/layout'
 import BaseMap from './BaseMap.vue'
-import { getFixedFlyPoint } from '@/utils/map/addTool.js'
+import { getFixedFlyPoint, PathPipe } from '@/utils/map/addTool.js'
 
 const layoutStore = useLayoutStore()
 
@@ -165,6 +165,7 @@ function handleToolClick(tool, childIndex) {
 					break
 				case 'tsjs': {
 					getFixedFlyPoint({ status: tool.active })
+					PathPipe({ status: tool.active })
 				}
 			}
 		}