Files
sdk4_demo/example/添加实体围墙.html
2025-07-03 15:12:58 +08:00

78 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<!-- <script src="https://cesium.com/downloads/cesiumjs/releases/1.98/Build/Cesium/Cesium.js"></script> -->
<script src="../sdk/YJEarth.min.js"></script>
<script src="vue.js"></script>
<style>
body {
width: 100%;
height: 100%;
}
/* 暗色主题 */
html.dark {
--w-e-textarea-bg-color: #333;
--w-e-textarea-color: #fff;
/* ...其他... */
}
</style>
</head>
<body>
<div id="app" class="fullSize">
</div>
</body>
</html>
<script>
new Vue({
el: "#app",
data: {
},
async mounted() {
await YJ.on()
this.createEarth()
},
methods: {
async createEarth() {
this.sdk = new YJ.YJEarth("app")
let openLeftClick = await new YJ.Global.openLeftClick(this.sdk)
let openRightClick = await new YJ.Global.openRightClick(this.sdk)
// let terrain = await new YJ.Obj.Terrain(this.sdk, {
// url: "http://127.0.0.1:8891/yjearth4.0/data/pak/1aa55c41643a44e079c4a6af03fd301c"
// })
YJ.Global.MouseRightMenu(this.sdk, true, (text, object) => {
console.log(text, object)
switch (text) {
case '绕中心点旋转':
YJ.Global.rotateAround(this.sdk, object.position)
break
case '属性':
break
}
})
let Draw = new YJ.Draw.DrawPolyline(this.sdk)
Draw.start((a, positions) => {
let WallStereoscopic = new YJ.Obj.WallRealStereoscopic(this.sdk, {
// id: '1111111111111111111',
color: "#ffffff",
positions: positions,
material: 1,
})
WallStereoscopic.edit(true)
WallStereoscopic.onClick = (a,b,c)=>{
alert(b)
}
window.WallStereoscopic = WallStereoscopic
})
}
}
})
</script>