1.加载天地图
var viewer = new Cesium.Viewer('cesiumContainer', {
baseLayerPicker: false,
imageryProvider: new Cesium.WebMapTileServiceImageryProvider({
url: "http://t0.tianditu.com/img_w/wmts?tk=你的秘钥&service=wmts&request=GetTile&version=1.0.0&LAYER=img&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default&format=tiles",
layer: "img",
style: "default",
format: "tiles",
tileMatrixSetID: "w",
//显示地图服务所属的提供商
credit: new Cesium.Credit('天地图全球影像服务',true),
subdomains: ['t0', "t1", "t2", "t3", "t4", "t5", "t6", "t7"],
maximumLevel: 18,
show: false
})
})
2.加载Arcgis服务。
1)加载Arcgis影像服务。
var viewer = new Cesium.Viewer('cesiumContainer', {
baseLayerPicker: false,
imageryProvider: new Cesium.UrlTemplateImageryProvider({
// url : 'http://192.168.120.130:6080/arcgis/rest/services/cy/Layers/ImageServer/exportImage?bbox={westProjected}%2C{southProjected}%2C{eastProjected}%2C{northProjected}&size={width}%2C{height}&f=image',
url : 'http://192.168.120.130:6080/arcgis/rest/services/cy/Layers/ImageServer/exportImage?bbox={westProjected},{southProjected},{eastProjected},{northProjected}&size={width}%2C{height}&f=image',
})
})
2)加载Arcgis地图服务。
var viewer = new Cesium.Viewer('cesiumContainer', {
baseLayerPicker: false,
imageryProvider: new Cesium.ArcGisMapServerImageryProvider({
url : 'http://192.168.120.130:6080/arcgis/rest/services/cy/layer_mh/MapServer'
})
}),
3.加载谷歌卫星影像。
var viewer = new Cesium.Viewer('cesiumContainer', {
baseLayerPicker: false,
imageryProvider:new Cesium.UrlTemplateImageryProvider({
url:"http://mt1.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali"
})
})