修改监控字体颜色

dianlixunjian
刘妍 2024-08-08 15:14:29 +08:00
parent 802fa91206
commit 35e9ffd026
1 changed files with 12 additions and 11 deletions

View File

@ -63,7 +63,6 @@
}, },
}, },
layers: [ layers: [
{ {
id: 'dianzi-biaozhu', id: 'dianzi-biaozhu',
type: 'raster', type: 'raster',
@ -93,7 +92,8 @@
layout: { layout: {
visibility: 'none', visibility: 'none',
}, },
},{ },
{
id: 'dianzi', id: 'dianzi',
type: 'raster', type: 'raster',
source: 'dianzi', source: 'dianzi',
@ -537,14 +537,13 @@
* *
* */ * */
function handlerChangeLayerVisible(layerName, checked) { function handlerChangeLayerVisible(layerName, checked) {
if(map.getLayer(layerName)){ if (map.getLayer(layerName)) {
if (checked) { if (checked) {
map.setLayoutProperty(layerName, 'visibility', 'visible'); map.setLayoutProperty(layerName, 'visibility', 'visible');
} else { } else {
map.setLayoutProperty(layerName, 'visibility', 'none'); map.setLayoutProperty(layerName, 'visibility', 'none');
} }
} }
} }
// //
@ -742,7 +741,9 @@
visibility: 'none', visibility: 'none',
}, },
paint: { paint: {
'text-color': '#fff', 'text-color': '#041B36',
'text-halo-color': '#fff',
'text-halo-width': 2,
}, },
}); });
@ -753,10 +754,10 @@
} }
// //
function handlerUpdateUavLayer(uavLayerGeoJson){ function handlerUpdateUavLayer(uavLayerGeoJson) {
if(map.getSource("uavSource")){ if (map.getSource('uavSource')) {
map.getSource("uavSource").setData(uavLayerGeoJson); map.getSource('uavSource').setData(uavLayerGeoJson);
}else{ } else {
map.loadImage('/videosupervision/uav.png', function (error, image) { map.loadImage('/videosupervision/uav.png', function (error, image) {
if (error) throw error; if (error) throw error;
if (!map.hasImage('uavIcon')) { if (!map.hasImage('uavIcon')) {
@ -786,7 +787,7 @@
}, },
paint: { paint: {
'text-color': '#fff', 'text-color': '#fff',
'text-halo-color':"#000", 'text-halo-color': '#000',
'text-halo-width': 1, 'text-halo-width': 1,
}, },
}); });
@ -799,7 +800,7 @@
handlerChangeLayerVisible, // handlerChangeLayerVisible, //
handlerLoadPolygon, handlerLoadPolygon,
handlerLocation, // handlerLocation, //
handlerUpdateUavLayer, // handlerUpdateUavLayer, //
}); });
</script> </script>
<style type="less" scoped> <style type="less" scoped>