67 lines
1.4 KiB
HTML
67 lines
1.4 KiB
HTML
|
<!--
|
||
|
* @name:
|
||
|
* @author: zh
|
||
|
* @date: Do not edit
|
||
|
* @update: Do not edit
|
||
|
* @description:
|
||
|
-->
|
||
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<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,
|
||
|
analysisObj: null
|
||
|
},
|
||
|
async mounted() {
|
||
|
await YJ.on()
|
||
|
this.createEarth()
|
||
|
},
|
||
|
methods: {
|
||
|
async createEarth() {
|
||
|
window.sdk = new YJ.YJEarth("app")
|
||
|
// 土方分析
|
||
|
this.analysisObj = new YJ.Analysis.CutFillAnalysis(window.sdk);
|
||
|
window.tileset = new YJ.Obj.Tileset(window.sdk, {
|
||
|
show: true,
|
||
|
url: "http://localhost:8891/yjearth4.0/data/tileset/24b9be7e2cdfa679b3a77c6c51b47bdc/tileset.json",
|
||
|
id: "123456",
|
||
|
position: { lng: 100, lat: 40, alt: 100 }
|
||
|
})
|
||
|
this.sdk = window.sdk
|
||
|
tileset.on().then((res) => {
|
||
|
console.log(res)
|
||
|
tileset.flyTo()
|
||
|
setTimeout(() => {
|
||
|
tileset.flyTo()
|
||
|
}, 3000);
|
||
|
// tileset.edit(true)
|
||
|
}).catch(msg => {
|
||
|
console.log(msg)
|
||
|
})
|
||
|
},
|
||
|
}
|
||
|
})
|
||
|
</script>
|