转自 https://www.cnblogs.com/s313139232/p/16351468.html
公共参数:
var token = '7b56038c276128a86a5b946404bf4df4';// 服务域名var tdtUrl = 'https://t{s}.tianditu.gov.cn/';// 服务负载子域var subdomains=['0','1','2','3','4','5','6','7'];
添加矢量底图:
let layer1 = new Cesium.WebMapTileServiceImageryProvider({ //全球矢量底图服务url: "http://t0.tianditu.gov.cn/vec_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk="+token,subdomains: subdomains,layer: "tdtImgLayer",style: "default",format: "image/jpeg",tileMatrixSetID: "GoogleMapsCompatible",//使用谷歌的瓦片切片方式show: true})
添加矢量底图注记:
letlayer2 = new Cesium.WebMapTileServiceImageryProvider({ url:"http://t0.tianditu.gov.cn/cva_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cva&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles
&tk="+token,
layer: "tdtCvaLayer",
style: "default", format: "image/jpeg", tileMatrixSetID: "GoogleMapsCompatible", }),
添加影像底图:
let layer3 = new Cesium.WebMapTileServiceImageryProvider({
url:"http://t0.tianditu.com/img_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk="+token,
layer: "tdtImgLayer", style: "default", format: "image/jpeg", tileMatrixSetID: "GoogleMapsCompatible", })
添加影像底图注记:
let layer4 = new Cesium.WebMapTileServiceImageryProvider({
url:"http://t0.tianditu.gov.cn/cia_w/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=cia&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles&tk="+token,
layer: "tdtCiaLayer", style: "default", format: "image/jpeg", tileMatrixSetID: "GoogleMapsCompatible", })
将底图添加到球上:
viewer.imageryLayers.addImageryProvider(wmsImageryProvider)
钻研不易,转载请注明出处。。。。。。