派生自 wuyushui/SewerAndRainNetwork

yangdelong
2021-05-19 31b82eeccef9f1e90f210e2f0b78304e7c3083d2
src/Sgis.js
@@ -1,10 +1,7 @@
import BasemapHelper from '@components/helpers/BasemapHelper'
import VectorLayerHelper from '@components/helpers/VectorLayerHelper'
// 初始化显示
// import '@components/plugin/PathDrag'
import MapConfig from '@/conf/MapConfig'
import MapConfig from './conf/MapConfig'
import '@components/plugin/PathDashFlow' // 流动线图
import DownLoad from '@components/plugin/DownLoad'
import DownLoad from './components/plugin/DownLoad'
// 测量
import '@components/plugin/leaflet-measure-path/leaflet-measure-path'
@@ -17,27 +14,28 @@
import '@/components/plugin/magicMarker.css'
import '@components/plugin/pulse/Pulse' // marker 外圈波
import '@components/plugin/pulse/Pulse.css' // marker 外圈波 css
import BasemapHelper from './components/helpers/BasemapHelper'
import VectorLayerHelper from './components/helpers/VectorLayerHelper'
// import '@/components/plugin/flowline'
// import eventBus from './eventBus'
let map = null
const L = window.L
const initMap = (div) => {
const initMap = (div, mapOption) => {
  if (map != null) {
    map.remove()
  }
  DownLoad.init(L)
  const option = mapOption || MapConfig.mapOptions
  map = L.map(div, option)
  map = L.map(div, MapConfig.mapOptions)
  map.on('click', (event, a, b) => {
    console.log(event, a, b)
  })
  // eventBus.$emit('map-obj', map)
  window.map = map
  window.L = L
  return map
}
/**
 * 基础底图初始化
 * @param map