From 83d9edbae17409ea9333a2ed24f597727cd6c81f Mon Sep 17 00:00:00 2001 From: helloxujingliang <3225043@qq.com> Date: Mon, 25 Nov 2024 17:05:26 +0800 Subject: [PATCH] merge --- src/api/tiankongdi/index.ts | 8 +++- src/views/sys/exception/Converge/index.vue | 43 +++++++++---------- .../exception/mapComponent/layers/index.vue | 14 +++--- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/src/api/tiankongdi/index.ts b/src/api/tiankongdi/index.ts index 9aa5b0e7..59799df4 100644 --- a/src/api/tiankongdi/index.ts +++ b/src/api/tiankongdi/index.ts @@ -56,7 +56,9 @@ enum Api { // 获取案件图片坐标、方位角信息 LoadCaseImgList = "/api/DroneCaseInfoSingle/LoadCaseImgList", // 获取范围内影像服务信息 - GetIntersects = "/api/GeoTiffManager/GetIntersects" + GetIntersects = "/api/GeoTiffManager/GetIntersects", + // 获取网络环境 + GetNetWorkEev = "/api/DroneCloudQuery/IsPublic", } /** @@ -169,4 +171,8 @@ export function getLoadCaseImgList(params){ export function getIntersectTif(params){ return defHttp.get({ url: Api.GetIntersects, params }); +} + +export function getNetworkType(){ + return defHttp.get({ url: Api.GetNetWorkEev }); } \ No newline at end of file diff --git a/src/views/sys/exception/Converge/index.vue b/src/views/sys/exception/Converge/index.vue index 3e64e0b2..aa0e61a9 100644 --- a/src/views/sys/exception/Converge/index.vue +++ b/src/views/sys/exception/Converge/index.vue @@ -31,7 +31,7 @@ import mapboxgl, { Map, Popup } from 'mapbox-gl'; import { MAPBOX_TOKEN, TINADITU_TOKEN, MAP_VIEWER } from './config.ts'; import heatGeoJson from './data.json'; - import { getPolygonCenter, getUserOrgs } from '@/api/tiankongdi'; + import { getPolygonCenter, getUserOrgs,getNetworkType } from '@/api/tiankongdi'; import axios from 'axios'; import SearchComponent from './SearchComponent.vue'; import { getAppEnvConfig } from '@/utils/env'; @@ -41,6 +41,10 @@ const mapContainerName = ref(); mapContainerName.value = 'mapContainer-' + generateUUID(); const { VITE_GLOB_YINGXIANG_SERVER, VITE_GLOB_YAOGANYINGXIANG_SERVER } = getAppEnvConfig(); + + const networkType = ref("WAN"); + + // import { TableOutlined, GlobalOutlined, HomeOutlined } from '@ant-design/icons-vue'; @@ -89,8 +93,6 @@ `http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=${TINADITU_TOKEN}`, ], tileSize: 256, - minzoom: 0, - maxzoom: 17, }, 'raster-tiles-font': { type: 'raster', @@ -132,7 +134,7 @@ type: 'raster', source: 'yaogan', layout: { - visibility: 'visible', + visibility: networkType.value == 'LAN' ? 'visible' : 'none', }, minzoom: 9, maxzoom: 15, @@ -142,7 +144,7 @@ type: 'raster', source: 'yingxiang', layout: { - visibility: 'visible', + visibility: networkType.value == 'LAN' ? 'visible' : 'none', }, minzoom: 13, maxzoom: 24, @@ -814,25 +816,17 @@ onMounted(() => { mapboxgl.accessToken = MAPBOX_TOKEN; - map = initMap(); - map.on('zoom', function (e) { - let zoom = map.getZoom(); - if (zoom > 18) { - console.log('zoom', zoom); - if (!isZoomVisible) { - isZoomVisible = true; - } else { - return; - } - } else { - isZoomVisible = false; + // 获取网络环境 + getNetworkType().then(res=>{ + if(res){ + networkType.value = "WAN"; + }else{ + networkType.value = "LAN"; } - if (isZoomVisible) { - } else { - } - }), + map = initMap(); + map.on('load', () => { //挂载mapbox-gl-utils U.init(map); @@ -863,7 +857,12 @@ // 视频监控 addMonitorLayer(); }); - }); + }); + + }) + + + // 抛出函数 defineExpose({ diff --git a/src/views/sys/exception/mapComponent/layers/index.vue b/src/views/sys/exception/mapComponent/layers/index.vue index 88b7db3f..74a58f4e 100644 --- a/src/views/sys/exception/mapComponent/layers/index.vue +++ b/src/views/sys/exception/mapComponent/layers/index.vue @@ -48,12 +48,10 @@ - -

地图底图

+

工作底图

-
@@ -146,15 +144,15 @@ const baseLayerList = ref([ { + id:2, + name:"影像地图", + checked:false, + value:"2" + },{ id:1, name:"导航地图", checked:false, value:"1" - },{ - id:2, - name:"卫星地图", - checked:false, - value:"2" },{ id:3, name:"白板地图",