派生自 wuyushui/SewerAndRainNetwork

XingChuan
2021-05-30 ca2a7113f660f523518c4be431534e7eebaa297e
src/components/helpers/LocateHelper.js
@@ -22,6 +22,7 @@
  if (filters.length > 0) {
    params.CQL_FILTER = filters.join(' AND ')
  }
  console.log(centerPoint)
  loadPointWfs(centerPoint, params)
}
@@ -47,7 +48,7 @@
  if (type === 'Point') {
    var point = feature.geometry.coordinates
    point = [point[1], point[0]]
    window.map.setView(point, 17)
    window.map.setView(point, 19)
  } else {
    window.map.fitBounds(window.L.geoJSON(feature).getBounds())
  }
@@ -130,8 +131,10 @@
  if (type === 'Point') {
    return [coordinates[1], coordinates[0]]
  } else {
    const center = L.geoJSON(feature, {}).getBounds().getCenter()
    return [center.lat, center.lng]
    return L.geoJSON(feature, {}).getBounds().getSouthWest()
    // return [center.lat, center.lng]
    // return turf.centerOfMass(L.geoJSON(feature, {}).toGeoJSON())
  }
}