<template>
  <div class="eleMap spacepicker" ref="pickerMap" style="width:100%;height:100%;" >
    <el-amap
      vid="picker"
      :amap-manager="amapManager"
      :zoom="mapZoom"
      :zooms="zooms"
      :center="mapCenter"
      :events="events"
    >
      <el-amap-info-window
        :position="infoWindow.position"
        :contentRender="infoWindow.contentRender"
        :visible="infoWindow.visible"
        :events="infoWindow.events">
      </el-amap-info-window>
    </el-amap>
    <div class="map-search-content">
      <a-input
        placeholder="请输入地理位置"
        style="width: 360px"
        v-model="searchValue"
        size="large"
      >
        <a-icon slot="suffix" :type="searchComlate?'close':'search'" style="font-size: 16px;line-height:22px;cursor:pointer" @click="onSearch(searchValue)"/>
      </a-input>
      <div id="panel" v-if="searchComlate" :style="{height:200+'px',overflow:'auto',width:'360px'}"></div>
    </div>
    <div class="map-right-action-content" v-if="operType!=='view'">
      <tooltip-button
        title="当前缩放级别"
      >{{ mapZoom }}</tooltip-button>
      <a-divider type="vertical" />
      <tooltip-button
        title="该类型只能添加、编辑点"
        icon="environment"
        v-if="spaceType==='point'"
        :disabled="mapData.length!==0"
        @click="drawPoint">点</tooltip-button>
      <tooltip-button title="该类型只能添加、编辑线" icon="share-alt" v-if="spaceType==='polyline'" @click="drawPolyline">线</tooltip-button>
      <tooltip-button title="该类型只能添加、编辑面" icon="radius-setting" v-if="spaceType==='polygon'" @click="drawPolygon">面</tooltip-button>
    </div>
    <a-card hoverable style="width: 80px;position:absolute;right:20px;bottom:20px;">
      <img
        style="height:60px;"
        alt="example"
        :src="mapLayerImg"
        slot="cover"
        @click="changeMapLayer"
      />
    </a-card>
  </div>
</template>
<script>
import VueAMap, { AMapManager } from 'vue-amap'
import handlePoint from './mixins/handlePoint.js'
import handlePolyline from './mixins/handlePolyline.js'
import handlePolygon from './mixins/handlePolygon.js'
VueAMap.initAMapApiLoader({
  key: 'efa2d531ff411f63c7afc2ef5f4d8221',
  plugin: [
    'AMap.Autocomplete',
    'AMap.ControlBar',
    'AMap.PlaceSearch',
    'AMap.Scale',
    'AMap.OverView',
    'AMap.ToolBar',
    'AMap.MapType',
    'AMap.MouseTool',
    'AMap.PolyEditor'
  ],
  v: '1.4.10',
  uiVersion: '1.0.11'
})
const amapManager = new AMapManager()
let $vue
let geocoder, marker
export default {
  name: 'SpacePicker',
  mixins: [handlePoint, handlePolyline, handlePolygon],
  model: {
    prop: 'mapData',
    event: 'input'
  },
  props: {
    center: {
      type: Array,
      default: () => {
        return [117.821013, 38.977696]
      }
    },
    // 空间类型(point,polygon,poline)
    spaceType: {
      type: String,
      default: 'point'
    },
    // 数据
    mapData: {
      type: Array,
      required: false,
      default: function () {
        return []
      }
    },
    // 操作类型 add,edit,view
    operType: {
      type: String,
      default: 'view'
    }
  },
  computed: {
    mapLayerImg () {
      const imgSL = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFQAAAA6CAIAAACh9+m8AAAgAElEQVRoBVV7SawtS3ZVREZEtufk6c+53et+31T5VxXlMqZwFZaQhZBNIywEEiNAMDADBAxgwAgmTBkxQQiEBANKYoIRsiVksMrGDS5X8/v/33/vvtufPk92kREZrJ33fWyf+9695+bJjIi9Y++11947Lt9snkrhcc9zpmq54kw6e+Dcc86x7sUZf148n8ZvJ17suPOYR5c95qzzPM45q6vVRf587dWNK19N3pmpI8dsy7p7uzsZ3nsew/0cv/P3sz/cN9uWea/2+o9i+cHWX9XrdTFpjV+Ww8noiyjetq3EvbQCLKN7qvvVYTEvl4WPMBbnEY9LV2BV+ADL7p5wWJXnSa8VWETrTOta6wxudsy1DEtrh8Fir1dyt9zg0m67Gwz7k+mYeQEkc7gD89DUGEcd98OCbZQ3dNxiOFoQBhAcq8PbOF4kosmKC9vWB7ub+0dti2XQOu811WKVmBM3cy64l6rR1myhvU0tHsb1k95rx8FsFb64M5f7KrxdvrXgn4VR3lqMQHJ3L9JBtyL8htk7VWAC17aeDVxIm0Hqpnu7efCRq1jRthY3QyUkBy0W6iMFSSdxg1wtt4dDqXz/6CRhDKvG3keM9OQzpjysn4nAizLz8fWt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SNuOegosFh0Tb+A20Z5x1HvUkiRqcKdzE85OTilVogQoi5HXI4NSeWzOXSM5PrwKYDWtyoEmMY9TyaFRWRV3kAfexT5HKxkswCL2HJqvb543nGQeaYE9owjldSflzwTUzzxOwCkuehxUBZIwQSDVVrxFOEwo70h7F24TeisR93sKg8llXCqc5+U9sU1nufLJQEqew71Wa5kUDJZR0xQBZw6nEjfJnBpIjGnzfMMcnPenRvEYdzKQcfx9TUTSSyKUjjGPpQA+eT5w2D8w4IFQpBvYbE3Z75pQBLIiM2zZnccVN9pjtHZFO4gcUB6kbxNGuWGO1OkeJYwUwCRyvUimSTG4yzvsTPQcmmRNy3kqDgdT1oERM0jAnGM0fOAPukjn3qYhgqhhyvr2pCON2ev4UAf//Z'
      return this.mapLayer === '矢量' ? imgSL : imgYX
    }
  },
  data () {
    return {
      searchValue: '',
      screenHeight: 0,
      mapCenter: this.center,
      mapZoom: 12,
      zooms: [8, 16],
      amapManager,
      map: null,
      mouseTool: null,
      searchComlate: false,
      bindObj: null,
      infoWindow: {
        position: [117.821013, 38.977696],
        visible: false,
        contentRender: h => h('a-button', {
          props: {
            icon: 'close',
            size: 'small',
            type: 'danger',
            shape: 'circle'
          },
          on: {
            click: () => {
              const obj = this.bindObj
              let bounds = []
              $vue.map.remove(obj)
              if ($vue.spaceType === 'point') {
                bounds = [obj.getPosition().lng, obj.getPosition().lat]
                if (JSON.stringify($vue.objData) === JSON.stringify(bounds)) {
                  $vue.objData = []
                }
              } else if (this.spaceType === 'polyline') {
                obj.getPath().forEach(line => {
                  bounds.push([line.lng, line.lat])
                })
                $vue.objData.forEach((item, index) => {
                  if (JSON.stringify(item) === JSON.stringify(bounds)) {
                    $vue.objData.splice(index, 1)
                  }
                })
              } else if (this.spaceType === 'polygon') {
                obj.getPath().forEach(line => {
                  bounds.push([line.lng, line.lat])
                })
                $vue.objData.forEach((item, index) => {
                  if (JSON.stringify(item) === JSON.stringify(bounds)) {
                    $vue.objData.splice(index, 1)
                  }
                })
              }
              $vue.infoWindow.visible = false
            }
          }
        }),
        obj: this.bindObj
      },
      events: {
        init (o) {
          $vue.map = o
        },
        complete () {
          $vue.mouseTool = new window.AMap.MouseTool($vue.map)
          $vue.map.setMapStyle('amap://styles/ba9dc3bd0fdf3b9dae118c289a46f7e8')
          $vue.drawOverLayers()
          $vue.handleDefaultTool()
          geocoder = new window.AMap.PlaceSearch({
            city: '022', // 城市设为北京，默认：“全国”
            panel: 'panel',
            autoFitView: true,
            citylimit: true
          })
          // 添加 3D 罗盘控制
          $vue.map.plugin(['AMap.ControlBar', 'AMap.Geocoder', 'AMap.Driving', 'AMap.Transfer', 'AMap.Walking'], function () {
            var controlBar = new window.AMap.ControlBar({ position: { right: '20px', top: '80px' } })
            $vue.map.addControl(controlBar)
          })
        },
        click (event) {
          $vue.infoWindow.visible = false
        },
        zoomchange () {
          $vue.mapZoom = $vue.map.getZoom()
        }
      },
      // state: 'ready', // ready,edit,add
      objData: [],
      mapLayer: '影像',
      layer: []
    }
  },
  methods: {
    // drawOverLayers
    drawOverLayers () {
      if ($vue.map) {
        $vue.map.clearMap()
      }
      if ($vue.mapData.length > 0) {
        if ($vue.spaceType === 'point') {
          marker = new window.AMap.Marker({
            position: new window.AMap.LngLat($vue.mapData[0], $vue.mapData[1]),
            map: $vue.map
          })
          $vue.mapCenter = $vue.mapData
          $vue.map.setFitView(marker)
          marker.state = 'ready'
          marker.on('rightclick', (e) => {
            $vue.handleRightClick(e.target)
          })
          marker.on('dblclick', (e) => {
            $vue.handleDblClick(e.target)
          })
        } else if ($vue.spaceType === 'polyline') {
          $vue.mapData.forEach((item) => { //
            const path = []
            item.forEach((longlat) => {
              path.push(new window.AMap.LngLat(longlat[0], longlat[1]))
            })
            const polyline = new window.AMap.Polyline({
              path: path,
              // map: $vue.map,
              strokeWeight: 8,
              strokeColor: '#3366FF'
            })
            polyline.state = 'ready'
            $vue.map.add(polyline)
            $vue.map.setFitView([ polyline ])
            $vue.map.plugin(['AMap.PolyEditor'], function () {
              polyline.polyEditor = new window.AMap.PolyEditor($vue.map, polyline)
              polyline.on('rightclick', (e) => {
                $vue.infoWindow.position = [e.lnglat.lng, e.lnglat.lat]
                $vue.handleRightClick(e.target)
              })
              polyline.on('dblclick', (e) => {
                $vue.handleDblClick(e.target)
              })
            })
          })
        } else if ($vue.spaceType === 'polygon') {
          $vue.mapData.forEach((item, index) => {
            const path = []
            item.forEach((longlat) => {
              path.push(new window.AMap.LngLat(longlat[0], longlat[1]))
            })
            const polygon = new window.AMap.Polygon({
              path: path,
              map: $vue.map,
              fillColor: '#40a4fd',
              fillOpacity: 0.5,
              strokeColor: '#40a4fd'
            })
            polygon.state = 'ready'
            if ($vue.map) {
              $vue.map.plugin(['AMap.PolyEditor'], () => {
                polygon.polyEditor = new window.AMap.PolyEditor($vue.map, polygon)
                $vue.map.setFitView([ polygon ])
                polygon.on('rightclick', (e) => {
                  $vue.infoWindow.position = [e.lnglat.lng, e.lnglat.lat]
                  $vue.handleRightClick(e.target)
                })
                polygon.on('dblclick', (e) => {
                  $vue.handleDblClick(e.target)
                })
              })
            }
          })
        }
        $vue.objData = $vue.mapData
      }
    },
    // 搜索定位
    onSearch (val) {
      if (val) {
        if (this.searchComlate) {
          geocoder.clear()
          this.searchComlate = false
        } else {
          this.searchComlate = true
          geocoder.search(val, (status, result) => {
            if (status === 'complete') {
              this.searchComlate = true
            } else {
              alert('根据地址查询位置失败')
            }
          })
          geocoder.on('listElementClick', (obj) => {
            this.searchValue = obj.data.name
            var lnglat = obj.data.location
            if (!marker) {
              marker = new window.AMap.Marker()
            }
            marker.setPosition(lnglat)
            $vue.map.setFitView(marker)
            geocoder.clear()
            this.searchComlate = false
          })
        }
      } else {
        this.searchComlate = false
      }
    },
    // 右键事件
    handleRightClick (obj) {
      if (!obj && $vue.map) {
        $vue.map.getAllOverlays(this.spaceType === 'point' ? 'marker' : this.spaceType).forEach(objItem => {
          $vue.handleRightClick(objItem)
        })
      } else if ($vue.map) {
        this.bindObj = obj
        if (this.operType !== 'view') {
          if (obj.state === 'ready') {
            // 展示删除
            if (this.spaceType === 'polyline' || this.spaceType === 'polygon') {
              this.infoWindow.position = [obj.getBounds().getCenter().lng, obj.getBounds().getCenter().lat]
            } else {
              this.infoWindow.position = [obj.getPosition().lng, obj.getPosition().lat]
            }
            this.infoWindow.visible = true
            // 判断删除位置
            obj.state = 'delete'
          } else if (obj.state === 'add') {
            obj.state = 'ready'
            // 退出新增
            $vue.mouseTool.close()
          } else if (obj.state === 'edit') {
            // 退出编辑
            if (this.spaceType === 'point') {
              obj.setDraggable(false)
            } else {
              obj.polyEditor.close()
            }
            obj.state = 'ready'
          } else if (obj.state === 'delete') {
            obj.state = 'ready'
          }
        } else {
          // 退出编辑
          if (this.spaceType === 'point') {
            obj.setDraggable(false)
          } else {
            obj.polyEditor.close()
          }
          obj.state = 'ready'
        }
      }
    },
    // 双击事件
    handleDblClick (obj) {
      if (this.operType !== 'view') {
        if (obj.state === 'ready') {
          obj.state = 'edit'
          // 进入编辑状态
          if (this.spaceType === 'point') {
            $vue.editPoint(obj)
          } else if (this.spaceType === 'polyline') {
            $vue.editPolyline(obj)
          } else if (this.spaceType === 'polygon') {
            $vue.editPolygon(obj)
          }
        } else if (obj.state === 'add') {
          obj.state = 'ready'
          $vue.mouseTool.close()
        }
      }
    },
    // handleDefaultTool
    handleDefaultTool () {
      if ($vue.operType === 'add') {
        if ($vue.spaceType === 'point') {
          $vue.drawPoint()
        } else if ($vue.spaceType === 'polyline') {
          $vue.drawPolyline()
        } else if ($vue.spaceType === 'polygon') {
          $vue.drawPolygon()
        }
      } else if ($vue.operType === 'edit' && $vue.map) {
        if ($vue.spaceType === 'point') {
          $vue.map.getAllOverlays('marker').forEach(obj => {
            $vue.editPoint(obj)
          })
        } else if ($vue.spaceType === 'polyline') {
          $vue.map.getAllOverlays('polyline').forEach(obj => {
            $vue.editPolyline(obj)
          })
        } else if ($vue.spaceType === 'polygon') {
          $vue.map.getAllOverlays('polygon').forEach(obj => {
            $vue.editPolygon(obj)
          })
        }
      } else {
        this.handleRightClick()
      }
    },
    // 切换地图图层
    changeMapLayer () {
      if (this.layer.length > 0) {
        this.layer.forEach((item, index) => {
          this.map.remove(item)
        })
        this.layer = []
      }
      if (this.mapLayer === '矢量') {
        this.mapLayer = '影像'
      } else {
        this.mapLayer = '矢量'
        this.layer.push(new window.AMap.TileLayer.Satellite())
        this.layer.push(new window.AMap.TileLayer({
          getTileUrl: 'http://218.67.246.252:83/imageMapServer/bigemap.dclrrys3/tiles/[z]/[x]/[y].png?access_token=pk.eyJ1IjoiY3VzXzc1cmJ5MjdwIiwiYSI6ImRlam5qeWZpbXJpd3VnZTRmYXJoeHNiejQiLCJ0IjoxfQ.hDFpINtoMCGJH6Sw2hhAt9VzqpKZ-vFAxmenzr08Ck4',
          zIndex: 100
        }))
        this.layer.forEach((item, index) => {
          this.map.add(item)
        })
      }
    }
  },
  mounted () {
    $vue = this
    if (this.$refs.pickerMap) {
      this.screenHeight = this.$refs.pickerMap.offsetHeight
    }
    window.addEventListener('resize', () => {
      if (this.$refs.pickerMap) {
        this.screenHeight = this.$refs.pickerMap.offsetHeight
      }
    })
  },
  watch: {
    objData (val) {
      this.$emit('input', val)
      this.$emit('change', val)
    },
    mouseTool () {
      this.mouseTool.off('draw').on('draw', (event) => {
        this.objData = []
        if ($vue.spaceType === 'polyline' || $vue.spaceType === 'polygon') {
          const bounds = []
          event.obj.getPath().forEach(line => {
            bounds.push([line.lng, line.lat])
          })
          this.objData.push(bounds)
          event.obj.state = 'add'
          $vue.map.plugin(['AMap.PolyEditor'], function () {
            event.obj.polyEditor = new window.AMap.PolyEditor($vue.map, event.obj)
          })
        } else {
          this.mouseTool.close()
          this.objData = [event.obj.getPosition().lng, event.obj.getPosition().lat]
        }
        event.obj.on('rightclick', (e) => {
          $vue.infoWindow.position = [e.lnglat.lng, e.lnglat.lat]
          if (!event.obj.state) {
            event.obj.state = 'ready'
          }
          $vue.handleRightClick(event.obj)
        })
        event.obj.on('dblclick', (e) => {
          event.obj.state = 'ready'
          $vue.handleDblClick(event.obj)
        })
      })
      // }
    },
    operType (val) {
      if (this.mouseTool) {
        this.mouseTool.close()
      }
      this.handleDefaultTool()
    },
    spaceType (val) {
      if (this.map) {
        this.map.clearMap()
      }
      this.objData = []
      this.handleDefaultTool()
    },
    mapData (val) {
      if (val !== this.objData) {
        if (this.mouseTool) {
          this.mouseTool.close()
        }
        if (this.map) {
          this.map.clearMap()
        }
        $vue.drawOverLayers()
        this.handleDefaultTool()
      }
    }
  },
  destroyed () {
    if (this.mouseTool) {
      this.mouseTool.close()
    }
  }
}
</script>
<style lang="less">
.eleMap.spacepicker{
  .map-search-content{
        position:absolute;
        top:20px;
        left:20px;
        box-shadow: 0 2px 2px rgba(0,0,0,.15);
        border-radius: 3px;
        width: 360px;
        .ant-btn{
          margin-left: -5px;
          border-radius: 0 4px 4px 0;
          vertical-align: top;
          border: 0;
          &::after{
            display:none;
          }
        }
        .ant-input-lg{
          border:0;
          box-shadow: unset;
        }
    }
  .map-right-action-content{
    padding:0;
    .ant-btn{
      padding:0 15px;
      &:hover{
        border-color: #2a82e4;
      }
    }
    .ant-btn:not(.active){
      color:rgba(0, 0, 0, 0.65);//#2a82e4;
    }
    .ant-btn:hover{
      color:#2a82e4;
      border-color: #2a82e4;
    }
  }
  .amap-info-content{
    background: none;
    border: 0;
    padding: 0;
    border-radius: 50%;
    overflow:hidden;
  }
  .amap-info-sharp{
    display:none;
  }
  .amap-info-close{
    position: absolute;
    top: -6px;
    right: -8px;
    width: 15px;
    height: 15px;
    font-size: 12px;
    background: #f08aae;
    border-radius: 50%;
    color: #fff;
    text-align: center;
    line-height: 15px;
    box-shadow: -1px 1px 1px rgba(10, 10, 10, .2);
    display:none;
  }
}
</style>
