63 lines
1.4 KiB
HTML
63 lines
1.4 KiB
HTML
<!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,
|
|
PolygonObject: null
|
|
},
|
|
async mounted() {
|
|
await YJ.on()
|
|
this.createEarth()
|
|
},
|
|
methods: {
|
|
async createEarth() {
|
|
this.sdk = new YJ.YJEarth("app")
|
|
YJ.Global.CesiumContainer(this.sdk, {
|
|
compass: true, // 罗盘
|
|
legend: true, // 比例尺
|
|
info: false, // 信息栏
|
|
frame: true // 刷新率
|
|
})
|
|
let Draw = new YJ.Draw.DrawAttackArrow(this.sdk)
|
|
Draw.start((a, positions) => {
|
|
console.log(positions)
|
|
for (let i = 0; i < positions.length; i++) {
|
|
positions[i].alt = 10000
|
|
}
|
|
let AttackArrowObject = new YJ.Obj.AttackArrowObject(this.sdk, { id: '11111', positions: positions, heightMode: 2 })
|
|
AttackArrowObject.Dialog.confirmCallBack = (v) => {
|
|
console.log(v.spreadState)
|
|
}
|
|
AttackArrowObject.edit(true)
|
|
// PolygonObject.create(positions)
|
|
AttackArrowObject.flyTo()
|
|
window.AttackArrowObject = AttackArrowObject
|
|
})
|
|
}
|
|
}
|
|
})
|
|
</script> |