派生自 wuyushui/SewerAndRainNetwork

徐旺旺
2021-05-19 f7b244103e748e051537cf4b46e875acaf56c450
src/components/helpers/LocateHelper.js
@@ -10,7 +10,6 @@
export const locate = function (feature, config, filter) {
  fitBounds(feature)
  highlight(feature, config.icon)
  setTimeout(() => {
    const centerPoint = getCenterPoint(feature)
    const params = { LAYERS: config.layerGroup || config.typeName, QUERY_LAYERS: config.layerGroup || config.typeName }
    const filters = []
@@ -23,8 +22,18 @@
    if (filters.length > 0) {
      params.CQL_FILTER = filters.join(' AND ')
    }
    window.mapManager.loadWfsDatas(centerPoint, params).then((res) => {
      openPropsPopup(centerPoint, res.features)
  loadPointWfs(centerPoint, params)
}
/**
 * 加载点范围的wfs数据并弹窗
 * @param latlng  点的经纬度坐标
 * @param params
 */
export const loadPointWfs = function (latlng, params) {
  setTimeout(() => {
    window.mapManager.loadWfsDatas(latlng, params).then((res) => {
      openPropsPopup(latlng, res.features)
    })
  }, 1000)
}
@@ -58,16 +67,7 @@
    // 叠加一个大尺寸的图标
    let point = feature.geometry.coordinates
    point = [point[1], point[0]]
    if (icon) {
      L.marker(point, {
        icon: L.icon({
          iconUrl: '/assets/images/map/' + icon,
          iconSize: [30, 30],
          iconAnchor: [15, 15]
        })
      }).addTo(highlightLayer)
    }
    pointZoom(point, icon)
    pulseEffect(point)
  } else {
    L.geoJSON(feature, {
@@ -81,6 +81,25 @@
}
/**
 * 高亮点位图标
 * @param latlng  经纬度
 * @param icon    图标
 */
export const pointZoom = function (latlng, icon) {
  const L = window.L
  const highlightLayer = window.mapManager.hightlightLayer
  if (icon) {
    L.marker(latlng, {
      icon: L.icon({
        iconUrl: '/assets/images/map/' + icon,
        iconSize: [30, 30],
        iconAnchor: [15, 15]
      })
    }).addTo(highlightLayer)
  }
}
/**
 * 弹出属性列表展示窗口
 * @param xy      弹出窗口跟随要素的经纬度
 * @param layer   查询指定的图层。不指定时,默认为勾选的图层