派生自 wuyushui/SewerAndRainNetwork

YANGDL
2021-01-05 77f7281ff7cee541aaa51339512e6443b7d89e42
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/**
 * 加载公共的图层,例如国界,铁路,蓝色地图等图层
 */
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