提交
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="app" class="fullSize">
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: {
|
||||
PolygonObject: null
|
||||
},
|
||||
async mounted() {
|
||||
await YJ.on()
|
||||
this.createEarth()
|
||||
},
|
||||
methods: {
|
||||
async createEarth() {
|
||||
window.sdk = this.sdk = new YJ.YJEarth("app")
|
||||
|
||||
let Draw = new YJ.Draw.DrawPolygon(this.sdk)
|
||||
Draw.start((a, positions) => {
|
||||
let options = {
|
||||
positions,
|
||||
label: {
|
||||
show: true,
|
||||
}
|
||||
}
|
||||
let PolyhedronObject = new YJ.Obj.PolyhedronObject(this.sdk, options)
|
||||
PolyhedronObject.edit(true)
|
||||
PolyhedronObject.Dialog.confirmCallBack = (v) => {
|
||||
console.log(v)
|
||||
}
|
||||
PolyhedronObject.flyTo()
|
||||
window.PolyhedronObject = PolyhedronObject
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user