派生自 wuyushui/SewerAndRainNetwork

chenzeping
2021-04-01 bd59f31b6d5d1de02edc3a454931303753cf9f43
src/components/BaseNav/SolidWaste/SolidWaste.js
@@ -1,7 +1,8 @@
import { QueryStoragePlaceListByCompanyAndName } from '@/api/request'
// 展示图片
import defaultImg from '@assets/images/map-pages/basenav/solidwaste/voc.png'
import Setting from '@assets/images/map-pages/basenav/solidwaste/gf_green.png'
import defaultImg from '../../../../public/assets/images/map/solidwaste/voc.png'
import setting from '../../../../public/assets/images/map/solidwaste/gf_green.png'
// 底图业务展示点
class AddSolidWasteHelper {
@@ -62,12 +63,8 @@
        // 点击 事件
        marker.on('click', (e) => {
          try {
            // console.log(e)
            // console.log(this.map.getCenter())
            // console.log(this.map.setCenter([e.target.getLatLng().lat, e.target.getLatLng().lng]))
            // this.map.flyTo([e.target.getLatLng().lat, e.target.getLatLng().lng])
            // this.map.panTo([e.target.getLatLng().lat, e.target.getLatLng().lng], 100)
            this.setPanTo(e.target.getLatLng(), 30)
            console.log(e.target.getLatLng())
            this.setPanTo(e.target.getLatLng(), 200)
            this.EffectOfPulse(e.target.getLatLng())
            this.SolidWastePopup.setData(data[i], 'gufei')
            return this.SolidWastePopup.$el
@@ -87,8 +84,9 @@
    position = this.map.latLngToLayerPoint(position)
    position.y += value
    position = this.map.layerPointToLatLng(position)
    this.map.setView(position)
    // this.map.flyTo(position)
    // this.map.setView(position)
    this.map.flyTo(position)
    // this.map.panTo(position)
  }
  // 固废点击进行的 内容的设置
@@ -113,7 +111,7 @@
      EffectOfChange = defaultImg
      this.EffectOfPulse(position, this.solidWasteMarkersLabels, this.SolidWasteLayerGroup)
    } else {
      EffectOfChange = Setting
      EffectOfChange = setting
    }
    return EffectOfChange
  }
@@ -121,32 +119,32 @@
  // 脉冲效果设置实现
  EffectOfPulse (position, markers, layerGroup) {
    // 区分直接执行 和判断执行的不同区别
    var differentColor = ''
    if (markers) {
      differentColor = '#ff0000'
    } else {
      differentColor = '#98FB98'
    }
    // 坐标数据:报警传进来的是数组 / 点击传进来的是object
    var FinalPosition = position instanceof Array ? {
      lat: position[0],
      lng: position[1]
    } : position
    // 插件 效果实现
    var pulsingIcon = this.L.icon.pulse({
      iconSize: [20, 20],
      color: differentColor,
      fillColor: ''
    })
    if (markers) {
      // markers.push(this.L.marker(FinalPosition, { icon: pulsingIcon }))
      // this.L.layerGroup(markers).addLayer(layerGroup)
    } else {
      var picGroupMarker = new this.L.FeatureGroup()
      this.L.marker(FinalPosition, { icon: pulsingIcon }).addTo(picGroupMarker)
      this.pulseHeighLightMarker = picGroupMarker.addTo(this.SolidWasteLayerGroup)
      this.PulseCountSetting()
    }
    // var differentColor = ''
    // if (markers) {
    //   differentColor = '#ff0000'
    // } else {
    //   differentColor = '#98FB98'
    // }
    // // 坐标数据:报警传进来的是数组 / 点击传进来的是object
    // var FinalPosition = position instanceof Array ? {
    //   lat: position[0],
    //   lng: position[1]
    // } : position
    // // 插件 效果实现
    // var pulsingIcon = this.L.icon.pulse({
    //   iconSize: [20, 20],
    //   color: differentColor,
    //   fillColor: ''
    // })
    // if (markers) {
    //   // markers.push(this.L.marker(FinalPosition, { icon: pulsingIcon }))
    //   // this.L.layerGroup(markers).addLayer(layerGroup)
    // } else {
    //   var picGroupMarker = new this.L.FeatureGroup()
    //   this.L.marker(FinalPosition, { icon: pulsingIcon }).addTo(picGroupMarker)
    //   this.pulseHeighLightMarker = picGroupMarker.addTo(this.SolidWasteLayerGroup)
    //   this.PulseCountSetting()
    // }
  }
  // 对图标脉冲 进行set设置  // 高亮图层