- 初始化配置参数说明
animation: false, //是否创建动画小器件,左下角仪表
baseLayerPicker: false, //是否显示图层选择器
fullscreenButton: false, //是否显示全屏按钮
geocoder: false, //是否显示geocoder小器件,右上角查询按钮
homeButton: false, //是否显示Home按钮
infoBox: false, //是否显示信息框
sceneModePicker: false, //是否显示3D/2D选择器
selectionIndicator: false, //是否显示选取指示器组件
timeline: false, //是否显示时间轴
sceneMode: Cesium.SceneMode.SCENE3D, //设定3维地图的默认场景模式:Cesium.SceneMode.SCENE2D、Cesium.SceneMode.SCENE3D、Cesium.SceneMode.MORPHING
navigationHelpButton: false, //是否显示右上角的帮助按钮
scene3DOnly: true, //如果设置为true,则所有几何图形以3D模式绘制以节约GPU资源
navigationInstructionsInitiallyVisible: false,
showRenderLoopErrors: false //是否显示渲染错误
//设置背景透明
orderIndependentTranslucency:false
contextOptions:{
webgl:{
alpha:true
}
}
- 隐藏logo
//方式一
this.viewer._cesiumWidget._creditContainer.style.display = "none";
//方式二 css
.cesium-widget-credits {
display: none !important;
visibility: hide !important;
}
- 自定义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
更多内容,欢迎关注公众号