【Cesium 基礎(chǔ)】基本配置參數(shù)說明

相關(guān)示例

  1. 初始化配置參數(shù)說明
      animation: false, //是否創(chuàng)建動(dòng)畫小器件,左下角儀表
      baseLayerPicker: false, //是否顯示圖層選擇器
      fullscreenButton: false, //是否顯示全屏按鈕
      geocoder: false, //是否顯示geocoder小器件,右上角查詢按鈕
      homeButton: false, //是否顯示Home按鈕
      infoBox: false, //是否顯示信息框
      sceneModePicker: false, //是否顯示3D/2D選擇器
      selectionIndicator: false, //是否顯示選取指示器組件
      timeline: false, //是否顯示時(shí)間軸
      sceneMode: Cesium.SceneMode.SCENE3D, //設(shè)定3維地圖的默認(rèn)場景模式:Cesium.SceneMode.SCENE2D、Cesium.SceneMode.SCENE3D、Cesium.SceneMode.MORPHING
      navigationHelpButton: false, //是否顯示右上角的幫助按鈕
      scene3DOnly: true, //如果設(shè)置為true,則所有幾何圖形以3D模式繪制以節(jié)約GPU資源
      navigationInstructionsInitiallyVisible: false,
      showRenderLoopErrors: false //是否顯示渲染錯(cuò)誤
      //設(shè)置背景透明
      orderIndependentTranslucency:false
      contextOptions:{
        webgl:{
          alpha:true
        }
      }
  1. 隱藏logo
//方式一 
this.viewer._cesiumWidget._creditContainer.style.display = "none";
//方式二 css
.cesium-widget-credits {
  display: none !important;
  visibility: hide !important;
}
  1. 自定義logo

 var mapDom = document.getElementById("cesiumContainer"); 
 var viewportQuad = new Cesium.ViewportQuad();
 viewportQuad.rectangle = new Cesium.BoundingRectangle(
        mapDom.clientWidth - 85,
        5,
        80,
        80
      );
 this.viewer.scene.primitives.add(viewportQuad);

 viewportQuad.material = new Cesium.Material({
        fabric: {
          type: "Image",
          uniforms: {
            color: new Cesium.Color(1.0, 1.0, 1.0, 1.0),
            image: "圖片路徑"
          }
        }
      });
    }



參考資料
https://zhuanlan.zhihu.com/p/41794192
https://zhuanlan.zhihu.com/p/48269042
https://www.cnblogs.com/mazhenyu/p/8534818.html


更多內(nèi)容,歡迎關(guān)注公眾號

seeling_GIS

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容