相关示例
- 初始化配置参数说明
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.MORPHINGnavigationHelpButton: false, //是否显示右上角的帮助按钮scene3DOnly: true, //如果设置为true,则所有几何图形以3D模式绘制以节约GPU资源navigationInstructionsInitiallyVisible: false,showRenderLoopErrors: false //是否显示渲染错误//设置背景透明orderIndependentTranslucency:falsecontextOptions:{
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
更多内容,欢迎关注公众号