fuliqi
2024-12-06 21933d0857b7539cfaff52a88a3340772160c4e7
src/views/screen/components/map3.vue
@@ -41,7 +41,7 @@
        },
        {
          name: '沿滩区',
          value: [104.80804, 29.100594, 300],
          value: [104.80504, 29.050594, 300],
          platformOnline: true
        },
        {
@@ -63,37 +63,51 @@
      markData: [
        {
          name: '自流井区',
          number: '0',
          value: [104.821471408, 29.950000, 300]
          video: '0',
          car: '0',
          face: '0',
          value: [104.911471408, 30.100000, 300]
        },
        {
          name: '高新区',
          number: '0',
          video: '0',
          car: '0',
          face: '0',
          value: [104.867237686031, 29.39548885792289, 300]
        },
        {
          name: '大安区',
          number: '0',
          value: [105.25337686031, 29.57948885792289, 300]
          video: '0',
          car: '0',
          face: '0',
          value: [105.12337686031, 29.38948885792289, 300]
        },
        {
          name: '沿滩区',
          number: '0',
          value: [105.30237686031, 30.20048885792289, 300]
          video: '0',
          car: '0',
          face: '0',
          value: [105.40537686031, 30.20048885792289, 300]
        },
        {
          name: '贡井区',
          number: '0',
          video: '0',
          car: '0',
          face: '0',
          value: [104.51037686031, 29.42048885792289, 300]
        },
        {
          name: '荣县',
          number: '0',
          video: '0',
          car: '0',
          face: '0',
          value: [104.25437686031, 29.64048885792289, 300]
        },
        {
          name: '富顺县',
          number: '0',
          video: '0',
          car: '0',
          face: '0',
          value: [105.208, 29.185, 300]
        }
      ],
@@ -108,6 +122,12 @@
    })
  },
  methods: {
    setFontSize(res){
      const clientWidth = window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;
      if (!clientWidth) return;
      let fontSize = clientWidth / 1920;
      return res*fontSize;
    },
    initializeMap() {
      this.updateMapData()
      this.getChinData('自贡市', chinaJson)
@@ -116,7 +136,9 @@
      if (this.geoCoordinates) {
        this.markData.forEach(item => {
          if (this.geoCoordinates[item.name]) {
            item.number = this.geoCoordinates[item.name].score || '0'
            item.video = this.geoCoordinates[item.name].video || '0.0'
            item.car = this.geoCoordinates[item.name].car || '0.0'
            item.face = this.geoCoordinates[item.name].face || '0.0'
          }
        })
      }
@@ -161,7 +183,7 @@
          left: '-5%',
          top: '20%',
          width: '100%', // 明确指定宽度
          height: '720px', // 明确指定高度
          height: '100%', // 明确指定高度
          // boxWidth: 100,
          regionHeight: 0.8,
          zlevel: 10,
@@ -259,7 +281,7 @@
            left: '-5%',
            top: '20%',
            width: '100%', // 明确指定宽度
            height: '720px', // 明确指定高度
            height: '100%', // 明确指定高度
            zlevel: 5,
            // tooltip: {
@@ -337,7 +359,7 @@
              {
                coords: [
                  [104.621171408, 29.150000, 300],
                  [104.891471408, 30.050000, 335]
                  [104.941471408, 30.190000, 335]
                ]
              },
              // 高新区线
@@ -351,14 +373,14 @@
              {
                coords: [
                  [104.95805, 29.155946, 300],
                  [105.24337686031, 29.61948885792289, 335]
                  [105.12137686031, 29.41948885792289, 335]
                ]
              },
              // 沿滩区线
              {
                coords: [
                  [104.80804, 29.100594, 300],
                  [105.41237686031, 30.30048885792289, 335]
                  [104.80504, 29.050594, 300],
                  [105.47237686031, 30.30048885792289, 335]
                ]
              },
              // 贡井区线
@@ -412,7 +434,7 @@
          position: 'top',
          textStyle: {
            color: '#c6f4ff',
            fontSize: '16px',
            fontSize: this.setFontSize(16),
            backgroundColor: 'rgba(25,56,97,1)',
            borderColor: '#a4ddee',
            borderWidth: 0.5,
@@ -422,12 +444,12 @@
          formatter: function (params) {
            // return `{style|${params.data.name} :${params.data.number}}`
            return `{style|${params.data.name} \n 视频:${params.data.number} \n 车辆:${params.data.number} \n 人脸:${params.data.number}}`
            return `{style|${params.data.name} \n 视频:${params.data.video} \n 车辆:${params.data.car} \n 人脸:${params.data.face}}`
          },
          rich: {
            style: {
              fontSize: 16,
              lineHeight: 22
              fontSize: this.setFontSize(14),
              lineHeight: this.setFontSize(20),
              // 其他需要的样式
            }
          },
@@ -468,6 +490,6 @@
.map-main-container {
  width: 100%;
  height: 100%;
  height: 37vw; // 固定高度
}
</style>