71 lines
1.7 KiB
HTML
71 lines
1.7 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%;
|
|
margin: 0;
|
|
}
|
|
|
|
#app {
|
|
width: 100%;
|
|
height: 100vh;
|
|
}
|
|
</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: {
|
|
async createEarth() {
|
|
window.sdk = await new YJ.YJEarth("app")
|
|
let terrain = await new YJ.Obj.Terrain(sdk, {
|
|
url: "http://localhost:8891/yjearth4.0/data/pak/1aa55c41643a44e079c4a6af03fd301c"
|
|
})
|
|
|
|
YJ.Global.CesiumContainer(sdk, {
|
|
compass: true, // 罗盘
|
|
legend: true, // 比例尺
|
|
info: true, // 信息栏
|
|
frame: true // 刷新率
|
|
})
|
|
|
|
let layer = new YJ.Obj.ArcgisWXImagery(sdk, {
|
|
id: 123,
|
|
show: true,
|
|
layer_index: 1
|
|
})
|
|
|
|
let Draw = new YJ.Draw.DrawRect(sdk)
|
|
Draw.start((a, positions) => {
|
|
// 等高线
|
|
let contour = new YJ.Analysis.Contour(sdk, { positions: positions });
|
|
// YJ.Analysis.Clear();
|
|
})
|
|
}
|
|
}
|
|
})
|
|
</script> |