src/views/car/index.vue
@@ -418,7 +418,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) {
@@ -573,7 +572,7 @@
    },
    // 数据类型
    dateChange(e) {
      this.sensorDate = e
      this.sensorDate = e;
      // if (this.view) {
      //   this.view.removeAllLayers()
      //   this.map.clearOverlays()
@@ -643,7 +642,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()
@@ -653,6 +652,7 @@
          that.msgTemp.pop()
        }
      }
    },
    // 走航车轨迹数据
    getStart() {
@@ -675,6 +675,7 @@
          time2
        }
      }).then(res => {
        console.log(res);
        if (!res.data.length) {
          this.noneData = true
          this.loading = false
@@ -718,12 +719,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)
@@ -765,7 +765,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
          })
@@ -784,14 +784,14 @@
        var levels = getGrading(sensor, type, carMac)
        $.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 // 楼块初始化升起时间
            })
@@ -813,7 +813,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), // 左下角
@@ -846,7 +846,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({
@@ -857,7 +857,7 @@
        })
        var lineLayer = new mapvgl.LineLayer({
          color: 'red',
          width: 3,
          width: 3,
          animation: true,
          duration: 10, // 循环时间2s
          trailLength: 0.1, // 拖尾长度占间隔的0.4