派生自 wuyushui/SewerAndRainNetwork

zhangshuaibao
2021-03-25 b820052f5bd13f1a88131f39055c49437652bd2c
src/Sgis.js
@@ -1,25 +1,29 @@
import BasemapHelper from '@components/helpers/BasemapHelper'
import VectorLayerHelper from '@components/helpers/VectorLayerHelper'
// 初始化显示
import ServiceLayerHelper from '@components/helpers/ServiceLayerHelper'
import Editable from '@components/plugin/Editable'
import PathDrag from '@components/plugin/PathDrag'
// import MagicMarker from '@components/plugin/MagicMarker'
// import WmtsSupport from '@components/plugin/wmts_plugins'
import '@components/plugin/PathDrag'
import MapConfig from '@/conf/MapConfig'
import '@components/plugin/PathDashFlow' // 流动线图
// import CanvasMarkers from '@components/plugin/CanvasMarkers'
// import FullScreen from '@components/plugin/FullScreen'
import DownLoad from '@components/plugin/DownLoad'
// 测量
import LeafletMeasurePath from '@components/plugin/leaflet-measure-path/leaflet-measure-path'
import '@components/plugin/leaflet-measure-path/leaflet-measure-path'
import 'leaflet.markercluster'
// import 'leaflet-canvas-markers'
import './components/plugin/Leaflet.GridLayer.FadeOut' // 瓦片图层切换淡入淡出
import './components/plugin/leaflet-canvas-markers' // 画布marker
import './components/plugin/Editable' // 标绘操作
import './components/plugin/MagicMarker' // 动画Marker
import './assets/css/map/magic.min.css' // 动画Marker css
import './components/BaseNav/Pulse'
import './components/BaseNav/Pulse.css'
// import WmtsSupport from '@components/plugin/wmts_plugins'
// import CanvasMarkers from '@components/plugin/CanvasMarkers'
// import FullScreen from '@components/plugin/FullScreen'
// import 'leaflet-canvas-markers'
let map = null
const L = window.L
const initMap = (div) => {
@@ -28,8 +32,8 @@
  }
  // Leaflet扩展代码
  Editable.init(L) // 图层编辑
  PathDrag.init(L) // 路径拖拽
  // Editable.init(L) // 图层编辑
  // PathDrag.init(L) // 路径拖拽
  // MagicMarker.init(L) // 动画Marker
  // WmtsSupport.init(L) // 扩展,使支持WMTS
  // CustomPopup.init(L) // 自定义弹出框
@@ -37,8 +41,8 @@
  // 全屏
  // FullScreen.init(L)
  // 下载
  // LeafletMeasurePath.init(L)
  DownLoad.init(L)
  LeafletMeasurePath.init(L)
  map = L.map(div, MapConfig.mapOptions)
@@ -48,7 +52,11 @@
  window.map = map
  window.L = L
  // L.sgis = L.sgis || L
  initTileLayersHelper(map)
  return map
}
@@ -70,7 +78,6 @@
  var serviceLayerHelper = new ServiceLayerHelper({ map })
  return serviceLayerHelper
}
/**
 * 矢量地图初始化
 * @param map