From 35e9ffd02657047b7acfccccd31976c77e028be1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=A6=8D?= <1455167345@qq.com> Date: Thu, 8 Aug 2024 15:14:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=91=E6=8E=A7=E5=AD=97?= =?UTF-8?q?=E4=BD=93=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exception/VideoSupervision/map/map.vue | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/views/sys/exception/VideoSupervision/map/map.vue b/src/views/sys/exception/VideoSupervision/map/map.vue index 522d66af..baeac05d 100644 --- a/src/views/sys/exception/VideoSupervision/map/map.vue +++ b/src/views/sys/exception/VideoSupervision/map/map.vue @@ -63,7 +63,6 @@ }, }, layers: [ - { id: 'dianzi-biaozhu', type: 'raster', @@ -93,7 +92,8 @@ layout: { visibility: 'none', }, - },{ + }, + { id: 'dianzi', type: 'raster', source: 'dianzi', @@ -537,14 +537,13 @@ * * */ function handlerChangeLayerVisible(layerName, checked) { - if(map.getLayer(layerName)){ + if (map.getLayer(layerName)) { if (checked) { map.setLayoutProperty(layerName, 'visibility', 'visible'); } else { map.setLayoutProperty(layerName, 'visibility', 'none'); } } - } // 切换县区 @@ -742,7 +741,9 @@ visibility: 'none', }, paint: { - 'text-color': '#fff', + 'text-color': '#041B36', + 'text-halo-color': '#fff', + 'text-halo-width': 2, }, }); @@ -753,10 +754,10 @@ } // 无人机图层 - function handlerUpdateUavLayer(uavLayerGeoJson){ - if(map.getSource("uavSource")){ - map.getSource("uavSource").setData(uavLayerGeoJson); - }else{ + function handlerUpdateUavLayer(uavLayerGeoJson) { + if (map.getSource('uavSource')) { + map.getSource('uavSource').setData(uavLayerGeoJson); + } else { map.loadImage('/videosupervision/uav.png', function (error, image) { if (error) throw error; if (!map.hasImage('uavIcon')) { @@ -786,7 +787,7 @@ }, paint: { 'text-color': '#fff', - 'text-halo-color':"#000", + 'text-halo-color': '#000', 'text-halo-width': 1, }, }); @@ -799,7 +800,7 @@ handlerChangeLayerVisible, // 控制图层显示隐藏 handlerLoadPolygon, handlerLocation, // 定位 - handlerUpdateUavLayer, // 无人机图层 + handlerUpdateUavLayer, // 无人机图层 });