Example:
//创建地图
var viewer = new Cesium.Map("cesiumContainer",{
showRenderLoopErrors : false,
baseLayerPicker : false,
infoBox : false
});
//加载图层
var tdt_img_provider = new Cesium.UrlTemplateImageryProvider({
url: "http://{s}.tianditu.com/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=e90d56e5a09d1767899ad45846b0cefd",
subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7']
});
var tdt_img_note_provider = new Cesium.UrlTemplateImageryProvider({
url: "http://{s}.tianditu.com/DataServer?T=cia_w&x={x}&y={y}&l={z}&tk=e90d56e5a09d1767899ad45846b0cefd",
subdomains: ['t0', 't1', 't2', 't3', 't4', 't5', 't6', 't7']
});
var tdt_img_layer = viewer.imageryLayers.addImageryProvider(tdt_img_provider);
var tdt_img_note_layer = viewer.imageryLayers.addImageryProvider(tdt_img_note_provider);
//定位
viewer.camera.flyTo({
destination : Cesium.Cartesian3.fromDegrees(114.31,30.52,500000.0)
});
//卷帘控件实例化
var splitSlider = new Cesium.GeoSplitSliderWidget({
viewer:viewer,
enableLayers: [tdt_img_note_layer,tdt_img_layer], //对指定图层开启卷帘效果
splitDirection: "left"
});
Demo: