创建新仓库
This commit is contained in:
74
static/example/添加轨迹运动.html
Normal file
74
static/example/添加轨迹运动.html
Normal file
@ -0,0 +1,74 @@
|
||||
<!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">
|
||||
<button class="button" @Click="Measure">测量</button>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: {
|
||||
sdk: null,
|
||||
PolylineObject: null
|
||||
},
|
||||
async mounted() {
|
||||
await YJ.on()
|
||||
this.createEarth()
|
||||
},
|
||||
methods: {
|
||||
createEarth() {
|
||||
this.sdk = new YJ.YJEarth("app")
|
||||
let Draw = new YJ.Draw.DrawPolyline(this.sdk)
|
||||
Draw.start((a, positions) => {
|
||||
console.log(positions)
|
||||
let TrajectoryMotion = new YJ.Obj.TrajectoryMotion(this.sdk, {
|
||||
name: '轨迹运动',
|
||||
loop: true,
|
||||
model: {
|
||||
show: true,
|
||||
url: "model/tank.glb",
|
||||
pixelSize: 70,
|
||||
scale: 1
|
||||
},
|
||||
line: {
|
||||
show: true,
|
||||
positions: positions
|
||||
}
|
||||
},
|
||||
{
|
||||
changeModelCallBack: () => {
|
||||
TrajectoryMotion.changeModelUrl('model/tank2.glb')
|
||||
}
|
||||
}
|
||||
)
|
||||
TrajectoryMotion.flyTo()
|
||||
TrajectoryMotion.edit(true)
|
||||
})
|
||||
},
|
||||
Measure() {
|
||||
let Draw = new YJ.Draw.DrawCircle(this.sdk)
|
||||
Draw.start((a, positions) => {
|
||||
console.log(positions)
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user