60 lines
1.1 KiB
HTML
60 lines
1.1 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,
|
||
|
},
|
||
|
async mounted() {
|
||
|
await YJ.on()
|
||
|
this.createEarth()
|
||
|
},
|
||
|
methods: {
|
||
|
createEarth() {
|
||
|
this.sdk = new YJ.YJEarth("app")
|
||
|
let Draw = new YJ.Draw.DrawPolygon(this.sdk)
|
||
|
|
||
|
Draw.start((a,positions)=>{
|
||
|
let WaterSurface = new YJ.Obj.WaterSurface(this.sdk, {
|
||
|
name: '水面',
|
||
|
positions: positions,
|
||
|
color: "#214387",
|
||
|
frequency: 10,
|
||
|
animationSpeed: 1,
|
||
|
amplitude: 10 },
|
||
|
{
|
||
|
confirmCallBack: () => {
|
||
|
alert('确认')
|
||
|
}
|
||
|
}
|
||
|
)
|
||
|
WaterSurface.edit(true)
|
||
|
WaterSurface.flyTo()
|
||
|
})
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
</script>
|