65 lines
1.7 KiB
HTML
65 lines
1.7 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<title>Title</title>
|
||
|
<!-- <script src="../sdk/Cesium/Cesium.js"></script> -->
|
||
|
<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="analysis">分析</button>
|
||
|
<button class="button" @Click="clear">清除</button>
|
||
|
</div>
|
||
|
</body>
|
||
|
|
||
|
</html>
|
||
|
|
||
|
<script>
|
||
|
new Vue({
|
||
|
el: "#app",
|
||
|
data: {
|
||
|
},
|
||
|
async mounted() {
|
||
|
await YJ.on()
|
||
|
await this.createEarth()
|
||
|
},
|
||
|
methods: {
|
||
|
async createEarth() {
|
||
|
window.sdk = new YJ.YJEarth("app")
|
||
|
window.tileset = new YJ.Obj.Tileset(sdk, {
|
||
|
show: true,
|
||
|
url: "http://127.0.0.1:8891/yjearth4.0/data/tileset/24b9be7e2cdfa679b3a77c6c51b47bdc/tileset.json",
|
||
|
id: "123456",
|
||
|
// position: { lng: 100, lat: 40, alt: 100 }
|
||
|
})
|
||
|
console.log(tileset)
|
||
|
tileset.on().then((res) => {
|
||
|
console.log(tileset.entity)
|
||
|
tileset.flyTo()
|
||
|
tileset.edit(true)
|
||
|
}).catch(msg => {
|
||
|
console.log(msg)
|
||
|
})
|
||
|
this.profile = new YJ.Analysis.Profile(sdk)
|
||
|
|
||
|
},
|
||
|
|
||
|
analysis() {
|
||
|
this.profile = new YJ.Analysis.Profile(sdk)
|
||
|
},
|
||
|
clear() {
|
||
|
YJ.Analysis.Clear();
|
||
|
}
|
||
|
}
|
||
|
})
|
||
|
</script>
|