Files
sdk4_demo/example/全局特效.html
2025-07-03 15:12:58 +08:00

70 lines
2.0 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!-- <script src="../sdk/Cesium/Cesium.js"></script> -->
<script src="../sdk/YJEarth.min.js"></script>
<script src="vue.js"></script>
<style>
body {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="app" class="fullSize">
</div>
</body>
</html>
<script>
new Vue({
el: "#app",
data: {
sdk: null,
},
async mounted() {
await YJ.on()
await this.createEarth()
},
methods: {
async createEarth() {
this.sdk = new YJ.YJEarth("app")
// 鼠标右键菜单点击回调
YJ.Global.MouseRightMenu(this.sdk, true, (text, object) => {
console.log(object)
switch (text) {
case 'rotateAround':
YJ.Global.rotateAround(this.sdk, object.position)
break
case 'edit':
break
}
})
YJ.Global.setCoordinateSystem('EPSG:32648')
YJ.Global.CesiumContainer(this.sdk, {
compass: true, // 罗盘
legend: true, // 比例尺
info: true, // 信息栏
frame: true // 刷新率
})
YJ.Global.efflect.rain(this.sdk, true) // 雨 (true:打开false:关闭)
// YJ.Global.efflect.snow(this.sdk, true) // 雪
// YJ.Global.efflect.fog(this.sdk, true) // 雾
// YJ.Global.efflect.nightVision(this.sdk, true) // 夜视
// YJ.Global.efflect.skyStarry(this.sdk, true) // 星空
// YJ.Global.efflect.illumination(this.sdk, true) // 光照
// YJ.Global.CameraController(this.sdk, false) // 相机锁定
}
}
})
</script>