提交
This commit is contained in:
58
example/添加双箭头面.html
Normal file
58
example/添加双箭头面.html
Normal file
@ -0,0 +1,58 @@
|
||||
<!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="testDiv" style="position: absolute; z-index: 999;background-color: #ffffff;padding: 20px;">一个div</div>
|
||||
<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")
|
||||
YJ.Global.CesiumContainer(this.sdk, {
|
||||
compass: true, // 罗盘
|
||||
legend: true, // 比例尺
|
||||
info: false, // 信息栏
|
||||
frame: true // 刷新率
|
||||
})
|
||||
let Draw = new YJ.Draw.DrawPincerArrow(this.sdk)
|
||||
Draw.start((a, positions) => {
|
||||
console.log(positions)
|
||||
if (positions) {
|
||||
let DrawAssemble = new YJ.Obj.PincerArrowObject(this.sdk, { positions: positions })
|
||||
DrawAssemble.edit(true)
|
||||
DrawAssemble.flyTo()
|
||||
DrawAssemble.setDIV({ domid: 'testDiv', x: -50, y: -160 })
|
||||
window.DrawAssemble = DrawAssemble
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user