| | |
| | | import BasemapHelper from '@components/helpers/BasemapHelper' |
| | | import VectorLayerHelper from '@components/helpers/VectorLayerHelper' |
| | | // 初始化显示 |
| | | import ServiceLayerHelper from '@components/helpers/ServiceLayerHelper' |
| | | |
| | | import '@components/plugin/PathDrag' |
| | | import MapConfig from '@/conf/MapConfig' |
| | | import '@components/plugin/PathDashFlow' // 流动线图 |
| | |
| | | |
| | | let map = null |
| | | const L = window.L |
| | | const initMap = (div) => { |
| | | const initMap = (div, mapOption) => { |
| | | if (map != null) { |
| | | map.remove() |
| | | } |
| | | DownLoad.init(L) |
| | | |
| | | map = L.map(div, MapConfig.mapOptions) |
| | | const option = mapOption || MapConfig.mapOptions |
| | | map = L.map(div, option) |
| | | |
| | | map.on('click', (event, a, b) => { |
| | | console.log(event, a, b) |
| | |
| | | |
| | | window.map = map |
| | | window.L = L |
| | | |
| | | initTileLayersHelper(map) |
| | | |
| | | return map |
| | | } |
| | |
| | | */ |
| | | const initBasemapsHelper = (map) => { |
| | | // todo 这里进行底图地图的初始化 |
| | | console.log(map) |
| | | return new BasemapHelper({ map }) |
| | | } |
| | | /** |
| | | * 业务底图初始化 |
| | | * @param map |
| | | * @param L |
| | | */ |
| | | const initTileLayersHelper = (map) => { |
| | | var serviceLayerHelper = new ServiceLayerHelper({ map }) |
| | | return serviceLayerHelper |
| | | } |
| | | |
| | | /** |
| | | * 矢量地图初始化 |
| | | * @param map |
| | |
| | | export default { |
| | | initMap, |
| | | initBasemapsHelper, |
| | | initTileLayersHelper, |
| | | initVectorLayersHelper |
| | | } |