代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>xt3d-sdk 快速开始</title>
<script src="https://cdn.jsdelivr.net/npm/cesium@1.84.0/Build/Cesium/Cesium.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/cesium@1.84.0/Build/Cesium/Widgets/widgets.css">
<!-- 引入插件 -->
<script src="./dist/xt3d.min.js"></script>
<style>
html,
body,
#map3d {
height: 100%;
width: 100%;
margin: 0px;
padding: 0px;
}
.cesium-credit-logoContainer {
display: none !important;
}
.cesium-widget-credits {
display: none !important;
}
</style>
</head>
<body>
<div class="map3d" id="map3d"></div>
</body>
<script>
var viewer = new Cesium.Viewer("map3d", {
infoBox: false,
selectionIndicator: false,
navigation: false,
animation: false,
shouldAnimate: false,
timeline: false,
baseLayerPicker: false,
geocoder: false,
homeButton: false,
sceneModePicker: false,
navigationHelpButton: false,
fullscreenButton: false,
imageryProvider: new Cesium.ArcGisMapServerImageryProvider({
url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer'
})
});
viewer.scene.fxaa = true;
viewer.scene.postProcessStages.fxaa.enabled = true;
//创建一条尾迹线
let positions = Cesium.Cartesian3.fromDegreesArrayHeights([108, 32, 10, 109, 32, 10]);
viewer.entities.add({
polyline: {
positions: positions,
width: 2,
material: new xt3d.PolylineObject.PolylineTrailMaterialProperty({
speed: 6 * Math.random(),
color: Cesium.Color.YELLOW,
percent: 0.5,
gradient: 0.01,
})
}
});
this.viewer.flyTo(this.viewer.entities);
</script>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。