派生自 wuyushui/SewerAndRainNetwork

陈泽平
2021-05-17 9f5456f88b8397ffbab1ad80331aaa834c15d882
src/utils/utils.js
@@ -27,15 +27,15 @@
 * 脉冲效果
 */
export function pulseEffect (xy) {
  let times = 5
  const colors = ['#98FB98', '#ff0000']
  let times = 50
  const colors = ['#00f100', '#ff0000']
  // 插件 效果实现
  var pulsingIcon = window.L.icon.pulse({
    iconSize: [20, 20],
    iconSize: [30, 30],
    color: colors[0],
    fillColor: ''
  })
  var picGroupMarker = window.L.marker(xy, { icon: pulsingIcon }).addTo(window.map)
  var picGroupMarker = window.L.marker(xy, { icon: pulsingIcon }).addTo(window.mapManager.hightlightLayer)
  // 定时
  var timeInterval = setInterval(() => {
    if (times > 0) {
@@ -47,6 +47,31 @@
  }, 1000)
}
export function reversePolyLine (feature) {
  const coordinates = feature.geometry.coordinates
  var latlng = []
  for (var j = 0; j < coordinates.length; j++) {
    const coordinate = coordinates[j]
    latlng.push(coordinate.reverse())
  }
  return latlng
}
export function reverseMultiLine (feature) {
  const coordinates = feature.geometry.coordinates
  var latlng = []
  for (var j = 0; j < coordinates.length; j++) {
    const coordinate = coordinates[j]
    var xy = []
    for (var k = 0; k < coordinate.length; k++) {
      const coor = coordinate[k]
      xy.push(coor.reverse())
    }
    latlng.push(xy)
  }
  return latlng
}
/**
 * 设置弹窗平移位置
 * @param pos