美文网首页
Cesium加载天地图

Cesium加载天地图

作者: 初见_JS | 来源:发表于2021-09-02 17:32 被阅读0次

    利用cesium加载在线天地图

    function addTDTLayer() {
      const tdt_tk = "02ed99e199228a5d47960a0324894605"; //一天只能请求一万次啊
    
      let TDTImgProvider = new Cesium.WebMapTileServiceImageryProvider({
        url: "http://t{s}.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&tk=" +
          tdt_tk,
        layer: "天地图影像",
        style: "default",
        format: "image/jpeg",
        subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
        tileMatrixSetID: "GoogleMapsCompatible",
      });
    
      let TDTZJProvider = new Cesium.WebMapTileServiceImageryProvider({
        url: "http://t{s}.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=" +
          tdt_tk,
        layer: "天地图中文注记",
        style: "default",
        format: "image/jpeg",
        subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
        tileMatrixSetID: "GoogleMapsCompatible",
      });
    
      viewer.imageryLayers.addImageryProvider(TDTImgProvider);
      viewer.imageryLayers.addImageryProvider(TDTZJProvider);
    }
    

    相关文章

      网友评论

          本文标题:Cesium加载天地图

          本文链接:https://www.haomeiwen.com/subject/irdcwltx.html