94 lines
2.8 KiB
HTML
94 lines
2.8 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>
|
|
<input type="number" v-model="precision">
|
|
</div>
|
|
</body>
|
|
|
|
</html>
|
|
|
|
<script>
|
|
new Vue({
|
|
el: "#app",
|
|
data: {
|
|
precision: 40
|
|
},
|
|
async mounted() {
|
|
await YJ.on()
|
|
await this.createEarth()
|
|
},
|
|
methods: {
|
|
async createEarth() {
|
|
window.sdk = new YJ.YJEarth("app")
|
|
// let tileset = new YJ.Obj.Tileset(sdk, {
|
|
// show: true,
|
|
// url: "http://127.0.0.1:8890/yjearth4.0/data/tileset/24b9be7e2cdfa679b3a77c6c51b47bdc/tileset.json",
|
|
// id: "123456",
|
|
// position: { lng: 100, lat: 40, alt: 2000 },
|
|
// })
|
|
// await tileset.on()
|
|
// tileset.flyTo()
|
|
let terrain = await new YJ.Obj.Terrain(sdk, {
|
|
url: "http://127.0.0.1:8891/yjearth4.0/data/pak/1aa55c41643a44e079c4a6af03fd301c"
|
|
})
|
|
|
|
let layer = new YJ.Obj.ArcgisWXImagery(sdk, {
|
|
id: 123,
|
|
show: true,
|
|
layer_index: 1
|
|
})
|
|
|
|
YJ.Global.flyTo(sdk, {
|
|
position: { lng: 88, lat: 26.8, alt: 50000 }, orientation: {
|
|
heading: 0,
|
|
pitch: Cesium.Math.toRadians(-35.0),
|
|
roll: 0.0
|
|
}
|
|
})
|
|
|
|
// this.ViewShed = new YJ.Analysis.ViewShed(this.sdk, {
|
|
// horizontalViewAngle: 30
|
|
// })
|
|
},
|
|
|
|
analysis() {
|
|
this.ViewShed = new YJ.Analysis.CircleViewShed(sdk, { precision: this.precision })
|
|
// this.ViewShed.createViewshed(20)
|
|
// setTimeout(() => {
|
|
// this.ViewShed.horizontalViewAngle = 150
|
|
// }, 3000);
|
|
console.log(this.ViewShed)
|
|
},
|
|
|
|
nodeEdit() {
|
|
this.ViewShed.nodeEdit()
|
|
// setTimeout(() => {
|
|
// this.ViewShed.viewPosition = { lng: 100, lat: 40, alt: 10 }
|
|
// }, 10000);
|
|
},
|
|
clear() {
|
|
console.log(YJ.Analysis)
|
|
YJ.Analysis.Clear();
|
|
this.ViewShed = null
|
|
}
|
|
}
|
|
})
|
|
</script> |