/** * 加载公共的图层,例如国界,铁路,蓝色地图等图层 */ import L from 'leaflet' import MapConfig from '@/conf/MapConfig' const tokenStr = 'tk=' + 'f1b72b5e7cb1175acddfa485f1bc9770' + '&' class CommonLayerLoad { // 中国蓝色覆盖层 loadBlueMap () { return L.tileLayer(MapConfig.BLUEMAP_HOST + '/server/ogcserver/whp_basemap_tile/wmts?x={x}&y={y}&z={z}', { maxZoom: 7, minZoom: 1, zoomOffset: 1 }) } // 道路路 loadNormalMap () { return L.tileLayer('http://t0.tianditu.gov.cn/vec_c/wmts?' + tokenStr + 'layer=cva&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}', { maxZoom: 18, minZoom: 1, zoomOffset: 1 }) } // 道路标注 loadNormalMapa () { return L.tileLayer('http://t0.tianditu.gov.cn/cva_c/wmts?' + tokenStr + 'layer=cva&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}', { maxZoom: 18, minZoom: 1, zoomOffset: 1 }) } // 影像图 loadImgMapm () { return L.tileLayer('http://t0.tianditu.gov.cn/img_c/wmts?' + tokenStr + 'layer=img&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}', { maxZoom: 18, minZoom: 1, zoomOffset: 1 }) } // 影像标注 loadImgMapa () { return L.tileLayer('http://t0.tianditu.gov.cn/cia_c/wmts?' + tokenStr + 'layer=cia&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}', { maxZoom: 18, minZoom: 1, zoomOffset: 1 }) } // 中石化内网影像图 loadIntranetImgMap (token) { return L.tileLayer('http://10.246.132.249:8080/OneMapServer/rest/services/base-tdt-image-globe/WMTS?token=' + token + '&' + 'layer=img&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}', { maxZoom: 18, minZoom: 1, zoomOffset: 1 }) } // 中石化内网影像图标注 loadIntranetImgMapCia (token) { return L.tileLayer('http://10.246.132.249:8080/OneMapServer/rest/services/base-tdt-label-image/WMTS?token=' + token + '&' + 'layer=cia&style=default&tilematrixset=c&Service=WMTS&Request=GetTile&Version=1.0.0&Format=tiles&TileMatrix={z}&TileCol={x}&TileRow={y}', { maxZoom: 18, minZoom: 1, zoomOffset: 1 }) } } export default CommonLayerLoad