提交
This commit is contained in:
64
example/截屏.html
Normal file
64
example/截屏.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!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">
|
||||
<button @click="start">截屏</button>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: "#app",
|
||||
data: {
|
||||
},
|
||||
async mounted() {
|
||||
await YJ.on()
|
||||
this.createEarth()
|
||||
},
|
||||
methods: {
|
||||
async createEarth() {
|
||||
window.sdk = await new YJ.YJEarth("app")
|
||||
// let layer = await new YJ.Obj.Layer(sdk, {
|
||||
// host: 'http://127.0.0.1:8890',
|
||||
// id: '3dffecc676ea1c1095900d18c89ecc5c',
|
||||
// show: true,
|
||||
// })
|
||||
// await layer.on()
|
||||
let layer2 = await new YJ.Obj.Layer(sdk, {
|
||||
host: 'http://127.0.0.1:8890',
|
||||
id: '108a5faa7ad776c807a7b2fbfa48bc0d',
|
||||
show: true,
|
||||
})
|
||||
await layer2.on()
|
||||
await layer2.flyTo()
|
||||
let layer3 = new YJ.Obj.ArcgisWXImagery(sdk, {
|
||||
id: 123,
|
||||
show: true,
|
||||
layer_index: 1
|
||||
})
|
||||
},
|
||||
|
||||
start() {
|
||||
YJ.Global.ScreenShot(sdk, (data) => {
|
||||
console.log(data)
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user