第一 初始化地图
专业能力不强,只为了自己查阅,希望指点
引用在线官网js
<script src="https://cesium.com/downloads/cesiumjs/releases/1.81/Build/Cesium/Cesium.js"></script>
<link href="https://cesium.com/downloads/cesiumjs/releases/1.81/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
创建容器
<div id="cesiumContainer"></div>
加载地图
const viewer = new Cesium.Viewer('cesiumContainer', {
});
其他常用配置
animation: false, //左下角的动画仪表盘
baseLayerPicker: false, //右上角的图层选择按钮
geocoder: false, //搜索框
homeButton: false, //home按钮
sceneModePicker: false, //模式切换按钮
timeline: false, //底部的时间轴
navigationHelpButton: false, //右上角的帮助按钮,
fullscreenButton: false, //右下角的全屏按钮
infoBox: false,//小弹窗
selectionIndicator: false,
zoomIndicatorContainer: false,
navigation: false,//指南针
// shadows: true,//阴影
1.关闭抗锯齿
viewer.scene.postProcessStages.fxaa.enabled = false;
2 调整分辨率
var imageResolution = viewer.cesiumWidget._supportsImageRenderingPixelated;
if (imageResolution) {
var Resolution = window.devicePixelRatio;
while (vtxf_dpr >= 2.0) {
vtxf_dpr /= 2.0;
}
viewer.resolutionScale = vtxf_dpr;
}
下面的调整分辨率是看了这个,嗯!没调试过:
https://blog.csdn.net/qq_34874034/article/details/105596185