Cesium loading images

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.