| | |
| | | import BasemapHelper from '@components/helpers/BasemapHelper' |
| | | import VectorLayerHelper from '@components/helpers/VectorLayerHelper' |
| | | |
| | | import Editable from '@components/plugin/Editable' |
| | | import PathDrag from '@components/plugin/PathDrag' |
| | | import CanvasIcon from '@components/plugin/CanvasMarkers' |
| | | import MagicMarker from '@components/plugin/MagicMarker' |
| | | // import Editable from '@components/plugin/Editable' |
| | | // import PathDrag from '@components/plugin/PathDrag' |
| | | // import CanvasIcon from '@components/plugin/CanvasMarkers' |
| | | // import MagicMarker from '@components/plugin/MagicMarker' |
| | | import 'leaflet.markercluster' |
| | | |
| | | import MapConfig from '@/conf/MapConfig' |
| | | import CommonLayerLoad from '@components/mapmodules/CommonLayerLoad' |
| | | import DashFlow from '@components/plugin/PathDashFlow' |
| | | import AjaxUtils from '@/utils/AjaxUtils' |
| | | // import DashFlow from '@components/plugin/PathDashFlow' |
| | | // import AjaxUtils from '@/utils/AjaxUtils' |
| | | let map = null |
| | | let baseMapGroup = null |
| | | // let baseMapGroup = null |
| | | let commonLayerLoad = null |
| | | const initMap = (div) => { |
| | | if (map != null) { |
| | | map.remove() |
| | | baseMapGroup = null |
| | | // baseMapGroup = null |
| | | commonLayerLoad = null |
| | | } |
| | | |
| | | Editable.init(L) |
| | | PathDrag.init(L) |
| | | MagicMarker.init(L) |
| | | CanvasIcon.init(L) |
| | | // Editable.init(L) |
| | | // PathDrag.init(L) |
| | | // MagicMarker.init(L) |
| | | // CanvasIcon.init(L) |
| | | |
| | | // CustomPopup.init(L) |
| | | // DashFlow.DashFlow(L) |
| | | map = L.map(div, MapConfig.mapOptions) |
| | | DashFlow.DashFlow(L, map) |
| | | // DashFlow.DashFlow(L, map) |
| | | commonLayerLoad = new CommonLayerLoad() |
| | | const blueMap = commonLayerLoad.loadBlueMap() |
| | | // const imgMapm = commonLayerLoad.loadImgMapm() |
| | | // const imgMapa = commonLayerLoad.loadImgMapa() |
| | | // L.layerGroup([normalMapm, normalMapa]).addTo(map) |
| | | baseMapGroup = L.layerGroup([blueMap]).addTo(map) |
| | | getToken() |
| | | // const blueMap = commonLayerLoad.loadBlueMap() |
| | | // baseMapGroup = L.layerGroup([blueMap]).addTo(map) |
| | | |
| | | const imgMapm = commonLayerLoad.loadImgMapm() |
| | | const imgMapa = commonLayerLoad.loadImgMapa() |
| | | |
| | | L.layerGroup([imgMapm, imgMapa]).addTo(map) |
| | | |
| | | // getToken() |
| | | // L.control.scale({ maxWidth: 200, metric: true, imperial: false }).addTo(map) |
| | | // L.control.layers(SgisConfig.baseLayers, SgisConfig.overlayLayers, { position: 'bottomright' }).addTo(map) |
| | | // 加载国界和铁路 |
| | |
| | | return { map: map, L: L } |
| | | } |
| | | |
| | | let getToken = () => { |
| | | let params = MapConfig.TokenConfig |
| | | AjaxUtils.GetDataAsynByUrl(params.url, params.option, function(token) { |
| | | showTdt(token) |
| | | }) |
| | | } |
| | | let showTdt = (token) => { |
| | | const imgMapm = commonLayerLoad.loadIntranetImgMap(token) |
| | | const imgMapa = commonLayerLoad.loadIntranetImgMapCia(token) |
| | | baseMapGroup.addLayer(imgMapm) |
| | | baseMapGroup.addLayer(imgMapa) |
| | | } |
| | | // let getToken = () => { |
| | | // let params = MapConfig.TokenConfig |
| | | // AjaxUtils.GetDataAsynByUrl(params.url, params.option, function(token) { |
| | | // showTdt(token) |
| | | // }) |
| | | // } |
| | | // let showTdt = (token) => { |
| | | // const imgMapm = commonLayerLoad.loadIntranetImgMap(token) |
| | | // const imgMapa = commonLayerLoad.loadIntranetImgMapCia(token) |
| | | // baseMapGroup.addLayer(imgMapm) |
| | | // baseMapGroup.addLayer(imgMapa) |
| | | // } |
| | | /** |
| | | * 瓦片底图初始化 |
| | | * @param map |