src/views/car/index.vue
@@ -411,7 +411,6 @@
    }
    // timeValue: {
    //   handler(newVal, oldVal) {
    //     console.log('时间是', this.timeValue, '日期是', this.sensorDate)
    //     this.sensorTime = this.newTime()
    //     console.log(this.sensorTime, 'this.sensorTime')
    //     // if (this.dataValue && this.timeValue) {
@@ -538,7 +537,7 @@
    },
    // 数据类型
    dateChange(e) {
      this.sensorDate = e
      this.sensorDate = e;
      // if (this.view) {
      //   this.view.removeAllLayers()
      //   this.map.clearOverlays()
@@ -608,7 +607,7 @@
        var lon = parseFloat(JSON.parse(msg.data).flylon)
        if (that.msgTemp.length < 2) {
          that.msgTemp.push({ lat: lat, lon: lon })
        }
        }
        var distance = that.GetDistance(that.msgTemp[0].lat, that.msgTemp[0].lon, that.msgTemp[1].lat, that.msgTemp[1].lon)
        if (distance >= 0.05) {
          that.msgTemp.shift()
@@ -618,6 +617,7 @@
          that.msgTemp.pop()
        }
      }
    },
    // 走航车轨迹数据
    getStart() {
@@ -640,6 +640,7 @@
          time2
        }
      }).then(res => {
        console.log(res);
        if (!res.data.length) {
          this.noneData = true
          this.loading = false
@@ -682,12 +683,11 @@
            lat = GPS.gcj_encrypt(lat, lng).lat
            lng = GPS.bd_encrypt(lat, lng).lon
            lat = GPS.bd_encrypt(lat, lng).lat
            var point = new BMapGL.Point(lng, lat)
            var point = new BMapGL.Point(lng, lat);
            point.a34004 = parseInt(value.a34004)
            point.a34002 = parseInt(value.a34002)
            point.a21026 = parseInt(value.a21026)
            point.a21004 = parseInt(value.a21004)
            // point.a21005 = parseInt(value.a21005)
            point.a21005 = parseFloat(value.a21005).toFixed(3)
            point.a05024 = parseInt(value.a05024)
            point.a99054 = parseFloat(value.a99054).toFixed(3)
@@ -724,7 +724,7 @@
        that.mapZoom = that.viewport.zoom
        that.centerPoint = that.viewport.center
        if (that.firstPlayFlag) {
          that.map.centerAndZoom(that.centerPoint, that.mapZoom)
              that.map.centerAndZoom(that.centerPoint, that.mapZoom)
          that.view = new mapvgl.View({
            map: that.map
          })
@@ -743,14 +743,14 @@
        var levels = getGrading(sensor, type)
        $.each(levels, function(index, value) {
          var color = value.color
          var data = value.data
          var data = value.data
          if (data.length > 0) {
            // 创建MapVGL图层管理器,需要使用插件mapvgl
            that.shapeLayer = new mapvgl.ShapeLayer({
              color: color, // 柱状图颜色
              enablePicked: true, // 是否可以拾取
              selectedIndex: -1, // 选中项
              selectedColor: '#ee1111', // 选中项颜色
              selectedColor: '#ee1111', // 选中项颜色
              autoSelect: true, // 根据鼠标位置来自动设置选中项
              riseTime: 1800 // 楼块初始化升起时间
            })
@@ -772,7 +772,7 @@
          var sw = getPoint(225, point.lng, point.lat, that.distance)
          var ne = getPoint(45, point.lng, point.lat, that.distance)
          var data = point[sensor]
          // 根据因子浓度变换方块颜色
          // 根据因子浓度变换方块颜色
          color = getColorAndLevel(sensor, data).color
          var polygon = new BMapGL.Polygon([
            new BMapGL.Point(sw.lng, sw.lat), // 左下角
@@ -805,7 +805,7 @@
        var points = []
        $.each(trackPoints, function(index, value) {
          var point = []
          point.push(value['lng'], value['lat'])
          point.push(value['lng'],value['lat'])
          points.push(point)
        })
        data.push({
@@ -816,7 +816,7 @@
        })
        var lineLayer = new mapvgl.LineLayer({
          color: 'red',
          width: 3,
          width: 3,
          animation: true,
          duration: 10, // 循环时间2s
          trailLength: 0.1, // 拖尾长度占间隔的0.4