Browse Source

新增图层

wisdom
biexueqin 4 weeks ago
parent
commit
c25a98e819
  1. BIN
      src/assets/highScore/monitoring.png
  2. BIN
      src/assets/highScore/tollStation.png
  3. 161
      src/components/Legend/index.vue
  4. 1140
      src/components/MapContainer/index.vue
  5. 1345
      src/views/highScore/dailyMonitoring/index.vue
  6. 262
      src/views/highScore/dailyMonitoring/test.ts

BIN
src/assets/highScore/monitoring.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
src/assets/highScore/tollStation.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

161
src/components/Legend/index.vue

@ -0,0 +1,161 @@
<template>
<div class="lanyer">
<div>
<img src="/src/assets/highScore/mapIcon1.png" />
图例名称
</div>
<div v-for="item in layerList" :key="item.id" class="custom-checkbox">
<label>
<input type="checkbox" :checked="item.show" @change="toggleLayer(item.layerName)"/>
<img :src="item.url" />
<span>{{ item.name }}</span>
</label>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed, watch } from 'vue';
const props = defineProps({
chooseBot: {
type: String,
default: ''
}
});
const emit = defineEmits(['layer-toggle']);
const allLayerLists = {
default: [
{
id: 1,
layerName: 'warnLayer',
name: '事件',
show: true,
url: new URL('@/assets/highScore/warnicon1.png', import.meta.url).href,
},
{
id: 2,
layerName: 'equipmentLayer',
name: '设备',
show: true,
url: new URL('@/assets/highScore/equipment.png', import.meta.url).href,
},
{
id: 3,
layerName: 'carLayer',
name: '车辆',
show: true,
url: new URL('@/assets/highScore/caricon.png', import.meta.url).href,
},
{
id: 4,
layerName: 'emergencyLayer',
name: '应急设施',
show: true,
url: new URL('@/assets/highScore/Materialsicon.png', import.meta.url).href,
},
],
charge: [
{
id: 1,
layerName: 'monitoring',
name: '监控',
show: true,
url: new URL('@/assets/highScore/monitoring.png', import.meta.url).href,
},
{
id: 2,
layerName: 'peopleLayer',
name: '设备',
show: true,
url: new URL('@/assets/highScore/equipment.png', import.meta.url).href,
},
{
id: 3,
layerName: 'carLayer',
name: '车辆',
show: true,
url: new URL('@/assets/highScore/caricon.png', import.meta.url).href,
},
{
id: 4,
layerName: 'tollStation',
name: '收费站',
show: true,
url: new URL('@/assets/highScore/tollStation.png', import.meta.url).href,
},
],
};
const layerList = ref(allLayerLists.default);
// chooseBot
const filteredLayerList = computed(() => {
return layerList.value.filter(item => item.show);
});
// chooseBot
watch(() => props.chooseBot, (newVal) => {
switch(newVal) {
case 'charge':
layerList.value = allLayerLists.charge;
break;
case 'dataChart':
layerList.value = allLayerLists.charge;
break;
default:
layerList.value = allLayerLists.default;
}
}, { immediate: true });
//
const toggleLayer = (layerName: string) => {
const layer = layerList.value.find(item => item.layerName === layerName);
if (layer) {
layer.show = !layer.show;
emit('layer-toggle', {
layerName,
show: layer.show
});
}
};
</script>
<style lang="less" scoped>
.lanyer {
padding: 30px 0 0 20px;
width: 500.34px;
height: 550.65px;
color: white;
z-index: 9999 !important;
position: absolute;
bottom: 20%;
right: 18%;
background: url('@/assets/highScore/lanyerBg.png') no-repeat 0 0/100% 100%;
div {
font-size: 40px;
}
.custom-checkbox {
margin: 30px 0 20px 80px; /* 调整间距 */
}
.custom-checkbox img {
width: 50px;
height: 50px;
filter: brightness(0.88) contrast(1.22) grayscale(0) hue-rotate(360deg) opacity(1) saturate(1.1) sepia(0.54) invert(0.9);
}
.custom-checkbox label {
display: flex;
align-items: center;
gap: 25px; /* 调整图标和文字的间距 */
cursor: pointer;
}
.custom-checkbox input[type='checkbox'] {
width: 40px;
height: 40px;
cursor: pointer;
}
.custom-checkbox span {
color: white;
font-size: 36px;
}
}
</style>

1140
src/components/MapContainer/index.vue

File diff suppressed because it is too large

1345
src/views/highScore/dailyMonitoring/index.vue

File diff suppressed because it is too large

262
src/views/highScore/dailyMonitoring/test.ts

@ -4,11 +4,15 @@ export const lineLayerData = {
{ {
geometry: { geometry: {
coordinates: [ coordinates: [
[106.548357837707, 29.58680219459827, 3], [106.540, 29.580, 3],
[106.5484601219108, 29.58680682983413, 3], [106.542, 29.581, 3],
[106.5484601219108, 29.58680682983413, 3], [106.544, 29.582, 3],
[106.5485623058675, 29.58681146052703, 3], [106.546, 29.583, 3],
[106.5486644902761, 29.58681609124043, 3], [106.548, 29.584, 3],
[106.550, 29.585, 3],
[106.552, 29.586, 3],
[106.554, 29.587, 3],
[106.556, 29.588, 3]
], ],
type: 'LineString', type: 'LineString',
}, },
@ -16,22 +20,20 @@ export const lineLayerData = {
color: '#ffff00', // 黄色 color: '#ffff00', // 黄色
UserID: 0, UserID: 0,
z: 3, z: 3,
width: 5 // 增加线宽
}, },
type: 'Feature', type: 'Feature',
}, },
{ {
geometry: { geometry: {
coordinates: [ coordinates: [
[106.5486644902761, 29.58681609124043, 3], [106.556, 29.588, 3],
[106.5488177260367, 29.58682303545917, 3], [106.558, 29.589, 3],
[106.5489199317008, 29.5868276671358, 3], [106.560, 29.590, 3],
[106.5490220371176, 29.58683229426947, 3], [106.562, 29.591, 3],
[106.5490730902784, 29.58683460785685, 3], [106.564, 29.592, 3],
[106.5490730902784, 29.58683660785685, 3], [106.566, 29.593, 3],
[106.5490730902784, 29.58683860785685, 3], [106.568, 29.594, 3]
[106.5490730902784, 29.58684060785685, 3],
[106.5490730902784, 29.58684260785685, 3],
], ],
type: 'LineString', type: 'LineString',
}, },
@ -39,49 +41,53 @@ export const lineLayerData = {
color: 'red', color: 'red',
UserID: 0, UserID: 0,
z: 3, z: 3,
width: 5 // 增加线宽
}, },
type: 'Feature', type: 'Feature',
}, },
], ],
}; };
export const lineLayerData1 = { export const lineLayerData1 = {
type: 'FeatureCollection', type: 'FeatureCollection',
features: [ features: [
{ {
geometry: { geometry: {
coordinates: [ coordinates: [
[106.5472909339584, 29.58596744065201, 3], [106.540, 29.595, 3],
[106.5472909339584, 29.58616744065201, 3], [106.545, 29.595, 3],
[106.5472909339584, 29.58636744065201, 3], [106.550, 29.595, 3],
[106.555, 29.595, 3],
[106.560, 29.595, 3],
[106.565, 29.595, 3],
[106.570, 29.595, 3]
], ],
// type: "LineString"
type: 'LineString', type: 'LineString',
}, },
properties: { properties: {
color: '#ffff00', // 黄色 color: '#ffff00', // 黄色
UserID: 0, UserID: 0,
z: 3, z: 3,
width: 5
}, },
type: 'Feature', type: 'Feature',
}, },
{ {
geometry: { geometry: {
coordinates: [ coordinates: [
[106.5472909339584, 29.58636744065201, 3], [106.570, 29.595, 3],
[106.5472909439584, 29.58666744065201, 3], [106.570, 29.590, 3],
[106.5472509439584, 29.58696744065201, 3], [106.570, 29.585, 3],
[106.5472609339584, 29.58726744065201, 3], [106.570, 29.580, 3],
[106.5472909339584, 29.58746744065201, 3], [106.570, 29.575, 3]
[106.5472909339584, 29.58766744065201, 3],
[106.5472909339584, 29.58776744065201, 3],
], ],
// type: "LineString"
type: 'LineString', type: 'LineString',
}, },
properties: { properties: {
color: 'red', color: 'red',
UserID: 0, UserID: 0,
z: 3, z: 3,
width: 5
}, },
type: 'Feature', type: 'Feature',
}, },
@ -94,29 +100,40 @@ export const lineLayerData2 = {
{ {
geometry: { geometry: {
coordinates: [ coordinates: [
[106.5486909339584, 29.58556744065201, 3], [106.545, 29.580, 3],
[106.5484909339584, 29.58596744065201, 3], [106.550, 29.585, 3],
[106.5484909339584, 29.58616744065201, 3], [106.555, 29.590, 3],
[106.5484909339584, 29.58636744065201, 3], [106.560, 29.595, 3],
[106.5484909339584, 29.58666744065201, 3], [106.565, 29.600, 3],
[106.5484909339584, 29.58696744065201, 3], [106.570, 29.605, 3],
[106.5484909339584, 29.58676744065201, 3], [106.575, 29.610, 3]
[106.5484909339584, 29.58686744065201, 3], ],
[106.5484909339584, 29.58696744065201, 3], type: 'LineString',
[106.5484909339584, 29.58706744065201, 3], },
[106.5484909339584, 29.58716744065201, 3], properties: {
[106.5484909339584, 29.58726744065201, 3], color: '#00ff00', // 绿色
[106.5484909339584, 29.58746744065201, 3], UserID: 0,
[106.5484909339584, 29.58756744065201, 3], z: 3,
[106.5484909339584, 29.58766744065201, 3], width: 8 // 更宽的线
[106.5484909339584, 29.58776744065201, 3], },
type: 'Feature',
},
{
geometry: {
coordinates: [
[106.575, 29.610, 3],
[106.570, 29.615, 3],
[106.565, 29.620, 3],
[106.560, 29.625, 3],
[106.555, 29.630, 3]
], ],
// type: "LineString"
type: 'LineString', type: 'LineString',
}, },
properties: { properties: {
color: '#0000ff', // 蓝色
UserID: 0, UserID: 0,
z: 3, z: 3,
width: 8
}, },
type: 'Feature', type: 'Feature',
}, },
@ -127,136 +144,134 @@ export const pointData = {
type: 'FeatureCollection', type: 'FeatureCollection',
features: [ features: [
{ {
w: 29.58596744065201, w: 29.54702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'G234', m: 'G234',
j: 106.5484909339584, j: 106.6812177260367,
h: '59838', h: '59838',
backgoundColor: 'red', backgoundColor: 'red',
}, },
{ {
w: 29.58596744065201, w: 29.60702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'G241', m: 'G234',
j: 106.5472909339584, j: 106.6812177260367,
h: '59838', h: '59838',
backgoundColor: 'red', backgoundColor: 'red',
}, },
{ {
w: 29.58798044065201, w: 29.60702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'G241', m: 'G234',
j: 106.5472909339584, j: 106.6312177260367,
h: '59838', h: '59838',
backgoundColor: 'red', backgoundColor: 'red',
}, },
{ {
w: 29.58648044065201, w: 29.65702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'G234', m: 'G234',
j: 106.5468909339584, j: 106.6022177260367,
h: '59838', h: '59838',
backgoundColor: 'red', backgoundColor: 'red',
}, },
{ {
w: 29.58728044065201, w: 29.65702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'G234', m: 'G234',
j: 106.5478909339584, j: 106.5622177260367,
h: '59838', h: '59838',
backgoundColor: 'red', backgoundColor: 'red',
}, },
{ {
w: 29.58768044065201, w: 29.63702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'G234', m: 'G234',
j: 106.5479909339584, j: 106.5822177260367,
h: '59838', h: '59838',
backgoundColor: 'red', backgoundColor: 'red',
}, },
{ {
w: 29.58608044065201, w: 29.58702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'G234', m: 'G234',
j: 106.5490909339584, j: 106.6022177260367,
h: '59838', h: '59838',
backgoundColor: 'red', backgoundColor: 'red',
}, },
{ {
w: 29.58668044065201, w: 29.55702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'G234', m: 'G234',
j: 106.5489909339584, j: 106.6022177260367,
h: '59838', h: '59838',
backgoundColor: 'red', backgoundColor: 'red',
}, },
{ {
w: 29.58650044065201, w: 29.65702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'x456', m: 'G234',
j: 106.5476909339584, j: 106.4822177260367,
h: '59838', h: '59838',
backgoundColor: 'skyblue', backgoundColor: 'red',
}, },
{ {
w: 29.58682044065201, w: 29.62702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'x456', m: 'x456',
j: 106.5480909339584, j: 106.5222177260367,
h: '59838', h: '59838',
backgoundColor: 'skyblue', backgoundColor: 'skyblue',
}, },
{ {
w: 29.58742044065201, //上下,大是越上 w: 29.60702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'x456', m: 'x456',
j: 106.5486909339584, //左右,大是往右偏 j: 106.5822177260367,
h: '59838', h: '59838',
backgoundColor: 'skyblue', backgoundColor: 'skyblue',
}, },
{ {
w: 29.58672044065201, w: 29.62702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'x456', m: 'x456',
j: 106.5494909339584, j: 106.6222177260367,
h: '59838', h: '59838',
backgoundColor: 'skyblue', backgoundColor: 'skyblue',
}, },
{ {
w: 29.58582044065201, w: 29.56702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'x456', m: 'x456',
j: 106.5492909339584, j: 106.5622177260367,
h: '59838', h: '59838',
backgoundColor: 'skyblue', backgoundColor: 'skyblue',
}, },
{ {
w: 29.58722044065201, w: 29.56702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'x456', m: 'x456',
j: 106.5498909339584, j: 106.5622177260367,
h: '59838', h: '59838',
backgoundColor: 'skyblue', backgoundColor: 'skyblue',
}, },
{ {
w: 29.58742044065201, w: 29.53742044065201,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'x456', m: 'x456',
@ -265,83 +280,74 @@ export const pointData = {
backgoundColor: 'skyblue', backgoundColor: 'skyblue',
}, },
{ {
w: 29.58742044065201, w: 29.59702303545917,
t: 24.6,
l: 11,
m: 'S234',
j: 106.55072909339584,
h: '59838',
backgoundColor: 'yellow',
},
{
w: 29.58762044065201,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'S234', m: 'x456',
j: 106.55122909339584, j: 106.5022177260367,
h: '59838', h: '59838',
backgoundColor: 'yellow', backgoundColor: 'skyblue',
}, },
{ {
w: 29.58662044065201, w: 29.57702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'S234', m: 'x456',
j: 106.55122909339584, j: 106.4822177260367,
h: '59838', h: '59838',
backgoundColor: 'yellow', backgoundColor: 'skyblue',
}, },
{ {
w: 29.58682044065201, w: 29.62702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'S234', m: 'S234',
j: 106.5498909339584, j: 106.4822177260367,
h: '59838', h: '59838',
backgoundColor: 'yellow', backgoundColor: 'yellow',
}, },
{ {
w: 29.58662044065201, w: 29.60702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'S234', m: 'S234',
j: 106.5496909339584, j: 106.462177260367,
h: '59838', h: '59838',
backgoundColor: 'yellow', backgoundColor: 'yellow',
}, },
{ {
w: 29.58762044065201, w: 29.54702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'S234', m: 'S234',
j: 106.5498909339584, j: 106.462177260367,
h: '59838', h: '59838',
backgoundColor: 'yellow', backgoundColor: 'yellow',
}, },
{ {
w: 29.58792044065201, w: 29.52702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'S234', m: 'S234',
j: 106.5496909339584, j: 106.442177260367,
h: '59838', h: '59838',
backgoundColor: 'yellow', backgoundColor: 'yellow',
}, },
{ {
w: 29.58792044065201, w: 29.56702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'S234', m: 'S234',
j: 106.5500909339584, j: 106.522177260367,
h: '59838', h: '59838',
backgoundColor: 'yellow', backgoundColor: 'yellow',
}, },
{ {
w: 29.58792044065201, w: 29.56702303545917,
t: 24.6, t: 24.6,
l: 11, l: 11,
m: 'S234', m: 'S234',
j: 106.5480909339584, j: 106.542177260367,
h: '59838', h: '59838',
backgoundColor: 'yellow', backgoundColor: 'yellow',
}, },
@ -620,46 +626,54 @@ export const chargeAddLayer4 = [
export const dailyAddLayer1 = [ export const dailyAddLayer1 = [
{ {
lng: 106.5509177260367, // 中心点经度 lng: 106.5509177260367,
lat: 29.58742303545917, // 中心点纬度 lat: 29.62742303545917,
},
{
lng: 106.4309177260367,
lat: 29.63942303545917,
}, },
]; ];
export const dailyAddLayer2 = [ export const dailyAddLayer2 = [
{ {
lng: 106.5509177260367, // 中心点经度 lng: 106.6089177260367,
lat: 29.58622303545917, // 中心点纬度 lat: 29.52922303545917,
}, },
{ {
lng: 106.5509177260367, // 中心点经度 lng: 106.6689177260367,
lat: 29.58622303545917, // 中心点纬度 lat: 29.51522303545917,
},
{
lng: 106.4889177260367,
lat: 29.53922303545917,
}, },
]; ];
//车辆 //车辆
export const dailyAddLayer3 = [ export const dailyAddLayer3 = [
{ {
lng: 106.5509177260367, // 中心点经度 lng: 106.6509177260367,
lat: 29.58712303545917, // 中心点纬度 lat: 29.58712303545917,
}, },
{ {
lng: 106.5469177260367, // 中心点经度 lng: 106.4069177260367,
lat: 29.58712303545917, // 中心点纬度 lat: 29.57712303545917,
}, },
{ {
lng: 106.5469177260367, // 中心点经度 lng: 106.4269177260367,
lat: 29.58602303545917, // 中心点纬度 lat: 29.50712303545917,
}, },
]; ];
//应急设施 //应急设施
export const dailyAddLayer4 = [ export const dailyAddLayer4 = [
{ {
lng: 106.5512177260367, // 中心点经度 lng: 106.7012177260367,
lat: 29.58702303545917, // 中心点纬度 lat: 29.57702303545917,
}, },
{ {
lng: 106.5505177260367, // 中心点经度 lng: 106.6312177260367,
lat: 29.58682303545917, // 中心点纬度 lat: 29.55702303545917,
}, },
]; ];

Loading…
Cancel
Save