<style lang='scss'>
  .mapContent {
    position: relative;
    margin-top: 10px;

    .center-add {
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      margin: auto;
      z-index: 999;
      width: 30px;
      height: 30px;
    }
  }

  #mapContainer {
    width: 100%;
    height: 506px;
  }

  #tip {
    position: absolute;
    top: -45px;
    display: flex;
  }

  #tip .el-input {
    // width: 179px;
    margin-right: 0px;
  }

  #tip .el-select {
    margin-right: 10px;
  }

  #tip .el-select {
    width: 179px;
  }

  #tip .el-textarea {
    width: 179px;

    /deep/ .el-textarea__inner {
      height: 40px;
      resize: none;
    }
  }

  .el-button--primary {
    background-color: #5878e8;
    border-color: #5878e8;
  }

  .el-button--default {
    color: #5878e8;
    border-color: #5473e8;
  }

  .address {
    display: flex;
    align-items: center;
    margin-right: 20px;

    .address-input {
      display: inline-block;
      width: 480px;
    }
  }

  .amap-marker {
    opacity: 0;
  }

  .amap-marker-label {
    background: #0000004f;
    z-index: 1158;
    border: 0px solid rgb(102, 102, 102);
    color: #eee;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    border-radius: 4px;
  }

  /*动画*/
  /*  .amap-marker-label {
    -webkit-animation: Tada 3s infinite;
    -moz-animation: Tada 3s infinite;
    -ms-animation: Tada 3s infinite;
    animation: Tada 3s infinite;
  }

  @keyframes Tada {
    0% {
      opacity: 0;


    }

    100% {
      opacity: 1;

    }
  } */
</style>

<template>
  <div class="mapContent">
    <div id="mapContainer"></div>
  </div>
</template>

<script>
  import {
    regionData,
    CodeToText,
    TextToCode
  } from 'element-china-area-data'
  import image from '../../../public/img/ic_locationmarker.jpg'
  import AMapLoader from '@amap/amap-jsapi-loader';
  export default {
    data() {
      return {
        mapPointData: {},
        mapLineData: {},
        map: null,
        provinces: [],
        province: '',
        districts: [],
        district: '',
        citys: [],
        city: '',
        polygons: [],
        selectedOptions1: [],
        areacode: '',
        address: '',
        objPoint: [],
        zoomEnable: true,
        dragEnable: true,
        status: true,
        center: '',
        markerList: [],
        timer: ''
      }
    },
    props: ['listData'],
    computed: {
      showFlag() {
        return this.flagVisible
      },
    },
    watch: {
      listData: function(val1, val2) {
        this.listData = val1
        var that = this
        this.makeJsonData()
        AMapLoader.load({
          'key': '211dd6f989e719022aaf47ddb0659c47', // 申请好的Web端开发者Key，首次调用 load 时必填
          'version': '2.0', // 指定要加载的 JSAPI 的版本，缺省时默认为 1.4.15
          'plugins': ['plugin=AMap.Scale', 'AMap.ToolBar','AMap.AutoComplete', 'AMap.PlaceSearch', 'AMap.Geocoder', 'AMap.DistrictSearch','AMap.Geolocation', 'Geolocation'],
          'Loca': { // 是否加载 Loca， 缺省不加载
            'version': '2.0.0' // Loca 版本，缺省 1.3.2
          },
        }).then((AMap) => {
          this.loadmap()
        }).catch(e => {
          console.log(e);
        })
      }
    },
    async created() {},
    mounted() {},
    beforeDestroy() {
      clearInterval(this.timer);
      if (this.timer) {
        clearInterval(this.timer); // 在Vue实例销毁前，清除定时器
      }
    },
    methods: {
      makeJsonData() {
        let _features1 = []
        let _features2 = []

        for (let i = 0; i < this.listData.biViewInfoList.length; i++) {
          let _data = this.listData.biViewInfoList[i]
          let _coordinates1 = []
          let _coordinates11 = []
          let _position1 = _data.endPlace ? _data.endPlace.split(',') : []
          _coordinates1.push(Number(_position1[1]))
          _coordinates1.push(Number(_position1[0]))
          let _obj1 = {
            'type': 'Feature',
            'properties': {
              'type': i,
            },
            'geometry': {
              'type': 'Point',
              'coordinates': _coordinates1
            }
          }
          let _position11 = _data.startPlace ? _data.startPlace.split(',') : []
          _coordinates11.push(Number(_position11[1]))
          _coordinates11.push(Number(_position11[0]))
          let _obj11 = {
            'type': 'Feature',
            'properties': {
              'type': i,
            },
            'geometry': {
              'type': 'Point',
              'coordinates': _coordinates11
            }
          }


          _features1.push(_obj1)
          _features1.push(_obj11)
          let _coordinates2 = []
          let _start = []
          let _end = []
          let _marker = {}
          let _positionStart = _data.startPlace ? _data.startPlace.split(',') : []
          _start.push(Number(_positionStart[1]))

          _start.push(Number(_positionStart[0]))
          let _positionEnd = _data.endPlace ? _data.endPlace.split(',') : []
          _end.push(Number(_positionEnd[1]))
          _end.push(Number(_positionEnd[0]))
          _coordinates2.push(_start)
          _coordinates2.push(_end)
          _marker.iconSrc = _start
          _marker.name = _data.name
          this.markerList.push(_marker)
          let _obj2 = {
            'type': 'Feature',
            'properties': {

            },
            'geometry': {
              'type': 'LineString',
              'coordinates': _coordinates2
            }
          }
          _features2.push(_obj2)
        }
        this.mapPointData = {
          'type': 'FeatureCollection',
          'features': _features1
        }
        this.mapLineData = {
          'type': 'FeatureCollection',
          'features': _features2
        }
        console.log('this.mapPointData', this.mapPointData)
        console.log('this.mapPointData', this.mapLineData)

      },
      loadmap(val) {
          let map = new AMap.Map('mapContainer', {
          zoom: 4.89,
          showLabel: true,
          viewMode: '3D',
          pitch: 0, //地圖仰角
          center: [122.122, 40.227],
          mapStyle: 'amap://styles/dark',
          buildingAnimation: false,
          showIndoorMap: false,
        });

        let loca = new Loca.Container({
          map,
        });
        for (let i = 0; i < this.markerList.length; i++) {
          // 构造点标记
          if (this.markerList[i].iconSrc[0] && this.markerList[i].iconSrc[1]) {
            let marker = new AMap.Marker({
              position: this.markerList[i].iconSrc,
              anchor: 'bottom-center',
              icon: new AMap.Icon({
                image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQEAAAEBCAYAAAB47BD9AAAACXBIWXMAAAsSAAALEgHS3X78AAATNElEQVR42u2d3XEbRxaFj5UAmQGxCZB0BIIjEByBoHdUGYrAUASGqviuYQQGI9AgggWQwA4yICLQPvTAoGxZmp7unumf71SxvFvFH6in+5tz7+2+/dOXL1+ECtLD7bWk++9+z+JQM1Dl6CcgkNUCv5d0LWna/ve82O8lXfX8rSdJu/Z/1y/++6zFYcegAwE07oKftgv8XtLdSJ9kK6lpwbADDEAAhV30s3bhv474k55aIJgvoAAEkFPsfl70Mwc7P7aOLRA2Whw2PFgggH68+Ofton+T4b/uJGkDEIAA+rbVXyb+xu/jEDa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V3EjcJAgDdcweJGYSCQvRuoRZvy70OSkiAQwA0Uqz0lQSBQihtoxM3GwBEIFC9uNv5a3CgMBIpzA5QMv9acIQACJYKADURG3CgMBHgDFix6BQCB4t1ArbJ7DnBKEAiggt0ANwoDAdS6gUZl3mw85+EDAfTSFpdVMqQkCATQ39xAaW3K2RgUiWg5HpvKaFNO+3CcACr4DcmNwkAA/SAsyL1NOTcKAwFUsBvgRmEggDq6gVxvNiYMAALIQivlVTLctqEOAgKooxtolFfJkDAACKAeyuWU4SMbg4AA6ucGcug5wClBIIAcQVAp7ZIhNwoDAVRwPM2NwkAAeXIDtdIsGdIrAAiggt0ANwoDAeTZDTRKq035iocGBJB/pdKmnBuFgQAK5AaelcbWW7YHAwEUEASV4r7ZmBuFgQAq+E3LjcJAAA3kBmrFuYGIG4WBABpQ88g+DzcKAwE0sBtoFFebcpKBQACNoJXiKBnSPhwIoJHcQCynDOc8DCCAxgPB2D0HuFEYCKCC38T0CgACKBI3UGuckiGnBIEAikhDZ+e5URgIoMjcwNBtyucMOhBAcbqBIUqGlASBAIrUDQx1szEbgzIStxLnqLA3G3OjME4AJaBVoN/LjcJAACUSFlQKUzLkRmEggAp2A9woDARQYm6glt+SIWEAEECJugEfJUNuFAYCKFE30MhPyZAwAAighOV6ypAbhYEAStwNuPQc4JQgEECZgKBSvzbl3CgMBFBGss3uc6MwEECZuYFa0pPFT9ArAAiggt0ANwoDAZSpG2jU7WbjFYMFBFC++tHNxpQEgQDK3A38qGSICwACqAAQ/NsGIm4UBgKoIM3/9v+5URgIoMLcQK2vew5wozAQQAW7AW4UBgKoUDfQyPQcoFdAwfo/Y31G2mVm8jQAAAAASUVORK5CYII=',
                size: new AMap.Size(30, 30), //图标所处区域大小
                imageSize: new AMap.Size(30, 30) //图标大小
              }),
            });
            map.add(marker);
            marker.setLabel({
              offset: new AMap.Pixel(0, 0), //设置文本标注偏移量
              content: '<div class = \'maker-item\'>' + this.markerList[i].name + '</div>', //设置文本标注内容
              direction: 'right' //设置文本标注方位

            });
          }
        }
        // 定时刷新动画
        let _markerDom = document.getElementsByClassName('amap-marker')

        let _index = 0
        this.timer = setInterval(function() {
          _markerDom[_index].style.opacity = 1
          _markerDom[_index].style.transition = '2s'
          let elseLi = _markerDom;
          for (let i = 0; i < elseLi.length; i++) {
            if (elseLi[i] !== _markerDom[_index]) { //判断是否是ele节点，是否与触发事件的节点相同
              elseLi[i].style.opacity = 0
              _markerDom[_index].style.transition = '2s'
            }
          }
          _index++;
          if (_index == _markerDom.length) _index = 0
        }, 3000)


        // 呼吸点
        let scatter = new Loca.ScatterLayer({
          loca,
          zIndex: 10,
          opacity: 0.6,
          visible: true,
          zooms: [2, 22],
        });

        let pointGeo = new Loca.GeoJSONSource({
          // url: 'https://a.amap.com/Loca/static/loca-v2/demos/mock_data/pulselink-china-city-point.json',
          data: this.mapPointData
        });
        scatter.setSource(pointGeo);
        scatter.setStyle({
          unit: 'meter',
          size: [100000, 100000],
          borderWidth: 0,
          texture: 'https://a.amap.com/Loca/static/loca-v2/demos/images/breath_red.png',
          duration: 2000,
          animate: true,
        });
        loca.add(scatter);

        // 弧线
        let pulseLink = new Loca.PulseLinkLayer({
          // loca,
          zIndex: 10,
          opacity: 1,
          visible: true,
          zooms: [2, 22],
          depth: true,
        });

        let geo = new Loca.GeoJSONSource({
          // url: 'https://a.amap.com/Loca/static/loca-v2/demos/mock_data/data-line-out.json',
          data: this.mapLineData
        });

        pulseLink.setSource(geo);
        pulseLink.setStyle({
          unit: 'meter',
          dash: [40000, 0, 40000, 0],
          lineWidth: function() {
            return [25000, 10000];
          },
          height: function(index, feat) {
            return feat.distance / 3 + 1000;
          },
          // altitude: 1000,
          smoothSteps: 50,
          speed: function(index, prop) {
            return 1000 + Math.random() * 300000;
          },
          flowLength: 200000,
          lineColors: function(index, feat) {
            return ['#ebf0f700'];
          },
          maxHeightScale: 0.3, // 弧顶位置比例
          headColor: 'rgb(36, 131, 255)',
          trailColor: 'rgba(255, 255,0,0)',
        });
        loca.add(pulseLink);
        loca.animate.start();
      }
    },
  }
</script>
