Files
sdk4_demo/example/添加贴地文字.html

55 lines
1.2 KiB
HTML
Raw Permalink Normal View History

2025-07-03 15:12:58 +08:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<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,
PolylineObject: null
},
async mounted() {
await YJ.on()
this.createEarth()
},
methods: {
async createEarth() {
this.sdk = new YJ.YJEarth("app")
// let tileset = await new YJ.Obj.Terrain(this.sdk, {
// url: "http://localhost:8888/yjearth4.0/data/pak/1aa55c41643a44e079c4a6af03fd301c"
// })
let Draw = new YJ.Draw.DrawPolyline(this.sdk, { number: 2 })
Draw.start((a, positions) => {
console.log('positions', positions)
let GroundText = new YJ.Obj.GroundText(this.sdk, {
positions: positions,
text: '他说她的绿色玻璃雨衣像一只瓶'
})
GroundText.edit(true)
GroundText.flyTo()
})
}
}
})
</script>