当前位置:网站首页>Cesium--- figure loading

Cesium--- figure loading

2022-06-25 13:23:00 Favorite truffle chocolate

// A vector is a border graph , An image is a real picture effect , The topographic map is the one in the geography book of junior middle school 
window.viewer = this.viewer = new Cesium.Viewer("cesium", {
  // Offline or not WebMapTileServiceImageryProvider This kind of can be written here 
  imageryProvider: new Cesium.BingMapsImageryProvider({
    url: "https://dev.virtualearth.net",
    key: "ArsDXFxRSS-STYkRkWGuelvpPho5_XlV88oSN98XBViYJFbaFDeiJpCnjRqGg70q",
    mapStyle: Cesium.BingMapsStyle.AERIAL,
  }), 
  // Administrative area map 
  // imageryProvider: new Cesium.UrlTemplateImageryProvider({
  //   url: "http://webrd02.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=8&x={x}&y={y}&z={z}",
  // }),
  shouldAnimate: true,
  animation: false,
  timeline: false,
  navigationHelpButton: false,
  selectionIndicator: true, // Remove target 
  sceneMode: 2,
  sceneModePicker: false, // Toggle 2D 
  creditContainer: document.createElement("div"),
  fullscreenButton: false,
  geocoder: false,
  homeButton: false,
  baseLayerPicker: false, // Remove the base layer 
  infoBox: false,

  // Solve the problem that the screenshot is completely black 
  contextOptions: {
    webgl: {
      alpha: true,
      depth: true,
      stencil: true,
      antialias: true,
      premultipliedAlpha: true,
      // adopt canvas.toDataURL() To implement the screenshot, you need to set this item to true
      preserveDrawingBuffer: true,
      failIfMajorPerformanceCaveat: true,
    },
  },
});
// If it is WebMapTileServiceImageryProvider Must be written on the outside , Cannot be added directly to imageryProvider In the attribute , Otherwise it shows a blue ball ...
// viewer.imageryLayers.addImageryProvider(
//   new Cesium.WebMapTileServiceImageryProvider({
//     url: "http://t0.tianditu.com/img_c/wmts?service=wmts&request=GetTile&version=1.0.0&LAYER=vec&tileMatrixSet=w&TileMatrix={TileMatrix}&TileRow={TileRow}&TileCol={TileCol}&style=default.jpg&tk=d6a72a78a43a2c17294b72ab26354cd6",
//     layer: "tdtImgBasicLayer",
//     style: "default",
//     format: "image/jpeg",
//     tileMatrixSetID: "GoogleMapsCompatible",
//     // maximumLevel: 18
//   })
// );
// Notes on Chinese place names 
viewer.imageryLayers.addImageryProvider(
  new Cesium.WebMapTileServiceImageryProvider({
    url: "http://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&tk=d6a72a78a43a2c17294b72ab26354cd6",
    layer: "tdtAnnoLayer",
    style: "default",
    format: "tiles",
    tileMatrixSetID: "GoogleMapsCompatible",
  })
);
// Remove copyright information 
viewer._cesiumWidget._creditContainer.style.display = "none";
//  Anti-Aliasing 
viewer.scene.postProcessStages.fxaa.enabled = false;
//  Water mist effect 
viewer.scene.globe.showGroundAtmosphere = true;
//  Overlay border services 
var iboMap = new Cesium.UrlTemplateImageryProvider({
  url:"https://t{s}.tianditu.gov.cn/DataServer?T=ibo_w&x={x}&y={y}&l={z}&tk=" +token,
  subdomains: subdomains,
  tilingScheme: new Cesium.WebMercatorTilingScheme(),
  maximumLevel: 10,
});
viewer.imageryLayers.addImageryProvider(iboMap);

原网站

版权声明
本文为[Favorite truffle chocolate]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202200524235982.html