Note: When using a custom data source, the Cesium.viewer class parameter must be set to
Baselayerpicker:false
A. Using A Day map data source
Day map
var provider=new cesium.webmaptileserviceimageryprovider ({
URL: ' Http://t0.tianditu.com/img_w/wmts? ',
Layer: ' img ',
Style: ' Default ',
Format: ' Tile ',
Tilematrixsetid: ' W ',
Credit:new cesium.credit (' Day map Global impact '),
Maximumlevel:18
});
var viewer = new Cesium.viewer (' Cesiumcontainer ', {
Imageryprovider:provider,
Baselayerpicker:true
});
Refer to Other
Global Vector Map Service
var viewer = new Cesium.viewer ("Cesiumcontainer", { animation:false,/ /whether the animated control is displayed Baselayerpicker:false,/ /whether to display the Layer selection control geocoder:true,//whether to display the place name lookup control Timeline:false,//whether to display the timeline control scenemodepicker:true,// Whether to display the projection mode control Navigationhelpbutton:false,//whether to display the Help information control infobox:true, //whether to display the information displayed after clicking the feature Imageryprovider:new cesium.webmaptileserviceimageryprovider ({ URL: "Http://t0.tianditu.com/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 ", layer:" Tdtvecbasiclayer ", style:" Default ", format:" Image/jpeg ", tilematrixsetid:" Googlemapscompatible " , Show:false })});
Global Image Map Service
var viewer = new Cesium.viewer ("Cesiumcontainer", { animation:false,/ /whether the animated control is displayed Baselayerpicker:false,/ /whether to display the Layer selection control geocoder:true,//whether to display the place name lookup control Timeline:false,//whether to display the timeline control scenemodepicker:true,// Whether to display the projection mode control Navigationhelpbutton:false,//whether to display the Help information control infobox:true, //whether to display the information displayed after clicking the feature Imageryprovider: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 ", layer:" Tdtbasiclayer ", style:" Default ", format:" Image/jpeg ", tilematrixsetid:" Googlemapscompatible ", Show:false });
Global Image Chinese Annotation service
Viewer.imageryLayers.addImageryProvider (New Cesium.webmaptileserviceimageryprovider ({ URL: "// t0.tianditu.com/cia_w/wmts?service=wmts&request=gettile&version=1.0.0&layer=cia&tilematrixset= W&tilematrix={tilematrix}&tilerow={tilerow}&tilecol={tilecol}&style=default.jpg ", layer:" Tdtannolayer ", style:" Default ", format:" Image/jpeg ", tilematrixsetid:" Googlemapscompatible ", Show:false}));
Global Vector Chinese Annotation Service
Viewer.imageryLayers.addImageryProvider (New Cesium.webmaptileserviceimageryprovider ({ URL: "// t0.tianditu.com/cva_w/wmts?service=wmts&request=gettile&version=1.0.0&layer=cva&tilematrixset= W&tilematrix={tilematrix}&tilerow={tilerow}&tilecol={tilecol}&style=default.jpg ", layer:" Tdtannolayer ", style:" Default ", format:" Image/jpeg ", tilematrixsetid:" Googlemapscompatible "}));
B using a custom data source
The custom image data range origin is west longitude-180, latitude 180 degrees,
var TMS = new Cesium.urltemplateimageryprovider ({
URL: ' Http://localhost:9999/mongodbwcfservice/gettilewithgeographictilingscheme/{z}/{x}/{y} ',
Credit: '? Analytical Graphics, Inc. ',
Tilingscheme:new Cesium.geographictilingscheme ({
Numberoflevelzerotilesx:4,
Numberoflevelzerotilesy:2
}),
Maximumlevel:16
});
Alert (' Data source is local (localhost:9999) ');
var viewer = new Cesium.viewer (' Cesiumcontainer ', {
Imageryprovider:tms,
Baselayerpicker:false,
Animation:false,
Geocoder:false,
Homebutton:false,
Infobox:false,
Timeline:false,
Navigationhelpbutton:false,
Navigationinstructionsinitiallyvisible:false
});
C Single Photo
var viewer = new Cesium.viewer (' Cesiumcontainer ', {
Imageryprovider:new Cesium.singletileimageryprovider ({
URL: './apps/sampledata/welcome.jpg '
}),
Baselayerpicker:false
});
Cesium loading images